diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-01-20 14:17:29 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-01-20 14:17:29 +0100 |
commit | cfdea3894f809aada2cf10ba2914aebe8b92316d (patch) | |
tree | 5b340c7026ed703aa225b716523ab033f8ae0a01 | |
parent | cd9311c8d6b7432f507e9eed12587c971875a9de (diff) | |
download | uci-cfdea3894f809aada2cf10ba2914aebe8b92316d.tar.gz |
fix signed vs unsigned char validation bugv0.7.3
-rw-r--r-- | util.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -86,7 +86,7 @@ __plugin bool uci_validate_str(const char *str, bool name) return false; while (*str) { - char c = *str; + unsigned char c = *str; if (!isalnum(c) && c != '_') { if (name || (c < 33) || (c > 126)) return false; @@ -114,8 +114,9 @@ static inline bool uci_validate_name(const char *str) bool uci_validate_text(const char *str) { while (*str) { - if ((*str == '\r') || (*str == '\n') || - ((*str < 32) && (*str != '\t'))) + unsigned char c = *str; + if ((c == '\r') || (c == '\n') || + ((c < 32) && (c != '\t'))) return false; str++; } |