wok-current view busybox/stuff/busybox-1.10.1-header_tar.u @ rev 3001

Up: alsa* (1.0.20)
author Christophe Lincoln <pankso@slitaz.org>
date Mon May 11 21:51:38 2009 +0200 (2009-05-11)
parents
children
line source
1 --- busybox-1.10.1/archival/libunarchive/get_header_tar.c
2 +++ busybox-1.10.1/archival/libunarchive/get_header_tar.c
3 @@ -24,18 +24,20 @@
4 };
5 #endif
7 -/* NB: _DESTROYS_ str[len] character! */
8 static unsigned long long getOctal(char *str, int len)
9 {
10 unsigned long long v;
11 + char last;
12 /* Actually, tar header allows leading spaces also.
13 * Oh well, we will be liberal and skip this...
14 * The only downside probably is that we allow "-123" too :)
15 if (*str < '0' || *str > '7')
16 bb_error_msg_and_die("corrupted octal value in tar header");
17 */
18 + last = str[len];
19 str[len] = '\0';
20 v = strtoull(str, &str, 8);
21 + str[len] = last;
22 if (*str && (!ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY || *str != ' '))
23 bb_error_msg_and_die("corrupted octal value in tar header");
24 return v;