123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifdef USE_HOSTCC
- #include <stdio.h>
- #endif
- #include <linux/ctype.h>
- #include <linux/string.h>
- char *skip_spaces(const char *str)
- {
- while (isspace(*str))
- ++str;
- return (char *)str;
- }
- char *strim(char *s)
- {
- size_t size;
- char *end;
- s = skip_spaces(s);
- size = strlen(s);
- if (!size)
- return s;
- end = s + size - 1;
- while (end >= s && isspace(*end))
- end--;
- *(end + 1) = '\0';
- return s;
- }
|