diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-11-17 11:28:00 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-11-17 11:28:00 +0000 |
commit | e766715032fa14ae60a053c41a1eeeb6046e19e2 (patch) | |
tree | b22a4e9950702bc3491176f0c46f01926e3113af | |
parent | b3a071543d777b1f6f7f31a326fefd17f1cf4951 (diff) | |
download | busybox-w32-e766715032fa14ae60a053c41a1eeeb6046e19e2.tar.gz busybox-w32-e766715032fa14ae60a053c41a1eeeb6046e19e2.tar.bz2 busybox-w32-e766715032fa14ae60a053c41a1eeeb6046e19e2.zip |
- end may be used uninitialized.
- TODO: should eventually use skip_whitespace there
-rw-r--r-- | coreutils/sort.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index 1ba05ecd7..a6c56ad88 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -51,7 +51,7 @@ static struct sort_key | |||
51 | 51 | ||
52 | static char *get_key(char *str, struct sort_key *key, int flags) | 52 | static char *get_key(char *str, struct sort_key *key, int flags) |
53 | { | 53 | { |
54 | int start=0,end,len,i,j; | 54 | int start = 0, end = 0, len, i, j; |
55 | 55 | ||
56 | /* Special case whole string, so we don't have to make a copy */ | 56 | /* Special case whole string, so we don't have to make a copy */ |
57 | if(key->range[0]==1 && !key->range[1] && !key->range[2] && !key->range[3] | 57 | if(key->range[0]==1 && !key->range[1] && !key->range[2] && !key->range[3] |
@@ -83,6 +83,7 @@ static char *get_key(char *str, struct sort_key *key, int flags) | |||
83 | /* Key with explicit separator starts after separator */ | 83 | /* Key with explicit separator starts after separator */ |
84 | if(key_separator && str[start]==key_separator) start++; | 84 | if(key_separator && str[start]==key_separator) start++; |
85 | /* Strip leading whitespace if necessary */ | 85 | /* Strip leading whitespace if necessary */ |
86 | //XXX: skip_whitespace() | ||
86 | if(flags&FLAG_b) while(isspace(str[start])) start++; | 87 | if(flags&FLAG_b) while(isspace(str[start])) start++; |
87 | /* Strip trailing whitespace if necessary */ | 88 | /* Strip trailing whitespace if necessary */ |
88 | if(flags&FLAG_bb) while(end>start && isspace(str[end-1])) end--; | 89 | if(flags&FLAG_bb) while(end>start && isspace(str[end-1])) end--; |