Mercurial > hg > sidinfo
comparison sidinfo.c @ 118:24583e5ca0b3
Simplify.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 16 Feb 2016 03:57:31 +0200 |
parents | d062312ea850 |
children | ecbc8cabd6a2 |
comparison
equal
deleted
inserted
replaced
117:36552c7d7171 | 118:24583e5ca0b3 |
---|---|
225 const char *end = strchr(start, ','); | 225 const char *end = strchr(start, ','); |
226 char *field = (end != NULL) ? | 226 char *field = (end != NULL) ? |
227 th_strndup_trim(start, end - start, TH_TRIM_BOTH) : | 227 th_strndup_trim(start, end - start, TH_TRIM_BOTH) : |
228 th_strdup_trim(start, TH_TRIM_BOTH); | 228 th_strdup_trim(start, TH_TRIM_BOTH); |
229 | 229 |
230 int found = argMatchPSFieldError(field); | 230 if (field != NULL) |
231 th_free(field); | 231 { |
232 | 232 int found = argMatchPSFieldError(field); |
233 if (found < 0) | 233 th_free(field); |
234 return FALSE; | 234 |
235 | 235 if (found < 0) |
236 item.cmd = found; | 236 return FALSE; |
237 item.str = NULL; | 237 |
238 if (!siStackAddItem(stack, &item)) | 238 item.cmd = found; |
239 return FALSE; | 239 item.str = NULL; |
240 if (!siStackAddItem(stack, &item)) | |
241 return FALSE; | |
242 } | |
240 | 243 |
241 if (!end) | 244 if (!end) |
242 break; | 245 break; |
243 | 246 |
244 start = end + 1; | 247 start = end + 1; |