[BACK]Return to sdiff.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sdiff

Diff for /src/usr.bin/sdiff/sdiff.c between version 1.26 and 1.27

version 1.26, 2009/06/07 13:09:24 version 1.27, 2009/06/07 13:15:13
Line 285 
Line 285 
         /* Subtract column divider and divide by two. */          /* Subtract column divider and divide by two. */
         width = (wflag - 3) / 2;          width = (wflag - 3) / 2;
         /* Make sure line_width can fit in size_t. */          /* Make sure line_width can fit in size_t. */
         if (width > (SIZE_T_MAX - 3) / 2)          if (width > (SIZE_MAX - 3) / 2)
                 errx(2, "width is too large: %zu", width);                  errx(2, "width is too large: %zu", width);
         line_width = width * 2 + 3;          line_width = width * 2 + 3;
   
Line 385 
Line 385 
                          * If rounding to next multiple of eight causes                           * If rounding to next multiple of eight causes
                          * an integer overflow, just return.                           * an integer overflow, just return.
                          */                           */
                         if (*col > SIZE_T_MAX - 8)                          if (*col > SIZE_MAX - 8)
                                 return;                                  return;
   
                         /* Round to next multiple of eight. */                          /* Round to next multiple of eight. */
Line 646 
Line 646 
                 if (file1start != file1end)                  if (file1start != file1end)
                         errx(2, "append cannot have a file1 range: %s",                          errx(2, "append cannot have a file1 range: %s",
                             line);                              line);
                 if (file1start == SIZE_T_MAX)                  if (file1start == SIZE_MAX)
                         errx(2, "file1 line range too high: %s", line);                          errx(2, "file1 line range too high: %s", line);
                 file1start = ++file1end;                  file1start = ++file1end;
         }          }
Line 658 
Line 658 
                 if (file2start != file2end)                  if (file2start != file2end)
                         errx(2, "delete cannot have a file2 range: %s",                          errx(2, "delete cannot have a file2 range: %s",
                             line);                              line);
                 if (file2start == SIZE_T_MAX)                  if (file2start == SIZE_MAX)
                         errx(2, "file2 line range too high: %s", line);                          errx(2, "file2 line range too high: %s", line);
                 file2start = ++file2end;                  file2start = ++file2end;
         }          }

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27