source:
freewrt/package/rrdcollect/patches/rrdcollect-scan.patch@
428f140
| Last change on this file since 428f140 was 475ad56, checked in by , 20 years ago | |
|---|---|
|
|
| File size: 1.6 KB | |
-
rrdcollect-0.2.3
diff -ruN rrdcollect-0.2.3.orig/src/scan.c rrdcollect-0.2.3/src/scan.c
old new 74 74 } while (isdigit(*fmt)); 75 75 } 76 76 77 /* skip white spaces like scanf does */ 78 if (strchr("difuoxX", *fmt)) 79 while (isspace(*buf)) 80 buf++; 81 77 82 /* FIXME: we should check afterward: 78 83 * if (start == buf || start == '-' && buf-start == 1) 79 84 * die("WTF??? zero-length number???"); … … 150 155 buf++, length--; 151 156 } 152 157 153 /* ignore if value not found */154 if(value == 0)155 return 0;156 157 158 if (!ignore) 158 counter[i++]->value = valuedup(value);159 counter[i++]->value = strndup(start, buf - start); 159 160 break; 160 161 161 162 case 'c': 163 if (length < 0) 164 length = 1; // default length is 1 165 162 166 while (*buf && length > 0) { 163 167 buf++, length--; 164 168 } 165 169 if (length > 0) 166 170 return 2; 167 171 168 /* ignore if value not found */169 if(value == 0)170 return 0;171 172 172 if (!ignore) 173 counter[i++]->value = valuedup(value);173 counter[i++]->value = strndup(start, buf - start); 174 174 break; 175 175 176 176 … … 192 192 case '\f': 193 193 case '\v': 194 194 /* don't match if not at least one space */ 195 if(!isspace(* (buf)))195 if(!isspace(*buf)) 196 196 return 0; 197 197 else 198 198 buf++; … … 208 208 case '\v': 209 209 break; 210 210 default: 211 while (isspace(* (buf)))211 while (isspace(*buf)) 212 212 buf++; 213 213 } 214 214 fmt++;
Note:
See TracBrowser
for help on using the repository browser.
