Changeset 171 for trunk/src/sh_tiger0.c
- Timestamp:
- Jul 8, 2008, 11:16:14 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_tiger0.c
r170 r171 843 843 static const int BLOCKSIZE = 8192; 844 844 struct md5_ctx ctx; 845 char buffer[8264]; /* BLOCKSIZE + 72 AIX compiler chokes */845 char * buffer = SH_ALLOC(8264); /* BLOCKSIZE + 72 AIX compiler chokes */ 846 846 size_t sum; 847 847 … … 870 870 SH_FREE(tmp); 871 871 *Length = 0; 872 SH_FREE(buffer); 872 873 return -1; 873 874 } … … 878 879 879 880 /* Iterate over full file contents. */ 880 while (1 == 1) {881 while (1) { 881 882 /* We read the file in blocks of BLOCKSIZE bytes. One call of the 882 883 computation function processes the whole buffer so that with the … … 894 895 { 895 896 if (sig_termfast == 1) 896 return -1; 897 { 898 SH_FREE(buffer); 899 return -1; 900 } 897 901 TPT((0, FIL__ , __LINE__ , _("msg=<SL_ISERROR (%ld)>\n"), n)); 898 902 tmp = sh_util_safe_name (filename); … … 909 913 SH_FREE(tmp); 910 914 *Length = 0; 915 SH_FREE(buffer); 911 916 return -1; 912 917 } … … 953 958 { 954 959 *Length = 0; 960 SH_FREE(buffer); 955 961 return -1; 956 962 } … … 969 975 970 976 *Length = bcount; 977 SH_FREE(buffer); 971 978 return 0; 972 979 } … … 1367 1374 static const int BLOCKSIZE = 4096; 1368 1375 struct sha_ctx ctx; 1369 char buffer[4168]; /* BLOCKSIZE + 72 AIX compiler chokes */1376 char * buffer = SH_ALLOC(4168); /* BLOCKSIZE + 72 AIX compiler chokes */ 1370 1377 off_t sum = 0; 1371 1378 char * tmp; … … 1393 1400 SH_FREE(tmp); 1394 1401 *Length = 0; 1402 SH_FREE(buffer); 1395 1403 return -1; 1396 1404 } … … 1417 1425 { 1418 1426 if (sig_termfast == 1) 1419 return -1; 1427 { 1428 SH_FREE(buffer); 1429 return -1; 1430 } 1420 1431 1421 1432 TPT((0, FIL__ , __LINE__ , _("msg=<SL_ISERROR (%ld)>\n"), n)); … … 1435 1446 SH_FREE(tmp); 1436 1447 *Length = 0; 1448 SH_FREE(buffer); 1437 1449 return -1; 1438 1450 } … … 1479 1491 { 1480 1492 *Length = 0; 1493 SH_FREE(buffer); 1481 1494 return -1; 1482 1495 } … … 1497 1510 sha_digest (&ctx, resblock); 1498 1511 *Length = bcount; 1512 SH_FREE(buffer); 1499 1513 return 0; 1500 1514 } … … 1505 1519 char * out, size_t len) 1506 1520 { 1507 int cnt = (int) Length; /* fix compiler warning */1521 int cnt; 1508 1522 char outbuf[KEY_LEN+1]; 1509 1523 unsigned char sha1buffer[20];
Note:
See TracChangeset
for help on using the changeset viewer.