wok-4.x annotate busybox/stuff/busybox-1.10.1-header_tar.u @ rev 2474
lua, lx*, lzlib: update depends
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Mar 15 20:05:38 2009 +0000 (2009-03-15) |
parents | |
children |
rev | line source |
---|---|
pascal@756 | 1 --- busybox-1.10.1/archival/libunarchive/get_header_tar.c |
pascal@756 | 2 +++ busybox-1.10.1/archival/libunarchive/get_header_tar.c |
pascal@756 | 3 @@ -24,18 +24,20 @@ |
pascal@756 | 4 }; |
pascal@756 | 5 #endif |
pascal@756 | 6 |
pascal@756 | 7 -/* NB: _DESTROYS_ str[len] character! */ |
pascal@756 | 8 static unsigned long long getOctal(char *str, int len) |
pascal@756 | 9 { |
pascal@756 | 10 unsigned long long v; |
pascal@756 | 11 + char last; |
pascal@756 | 12 /* Actually, tar header allows leading spaces also. |
pascal@756 | 13 * Oh well, we will be liberal and skip this... |
pascal@756 | 14 * The only downside probably is that we allow "-123" too :) |
pascal@756 | 15 if (*str < '0' || *str > '7') |
pascal@756 | 16 bb_error_msg_and_die("corrupted octal value in tar header"); |
pascal@756 | 17 */ |
pascal@756 | 18 + last = str[len]; |
pascal@756 | 19 str[len] = '\0'; |
pascal@756 | 20 v = strtoull(str, &str, 8); |
pascal@756 | 21 + str[len] = last; |
pascal@756 | 22 if (*str && (!ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY || *str != ' ')) |
pascal@756 | 23 bb_error_msg_and_die("corrupted octal value in tar header"); |
pascal@756 | 24 return v; |