projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd9311c
)
fix signed vs unsigned char validation bug
author
Felix Fietkau
<nbd@openwrt.org>
Tue, 20 Jan 2009 13:17:29 +0000
(14:17 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Tue, 20 Jan 2009 13:17:29 +0000
(14:17 +0100)
util.c
patch
|
blob
|
history
diff --git
a/util.c
b/util.c
index
e56992e
..
cb88968
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-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++;
}