Silencing warning in instances with char is unsigned. (#208)
* Silencing warning in instances with char is unsigned. * Damn it.
This commit is contained in:
parent
3bd3116cf8
commit
14ee003907
|
@ -2,6 +2,7 @@
|
|||
#include <cstring>
|
||||
#include <dirent.h>
|
||||
#include <inttypes.h>
|
||||
#include <climits>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -70,10 +71,17 @@ static bool parse_string(const char *p, char *output, char **end) {
|
|||
p++;
|
||||
|
||||
for (;;) {
|
||||
|
||||
#if (CHAR_MIN < 0) || (!defined(CHAR_MIN)) // the '!defined' is just paranoia
|
||||
// in this path, char is *signed*
|
||||
if ((*p >= 0 && *p < 0x20)) {
|
||||
return false; // unescaped
|
||||
}
|
||||
#else
|
||||
// we have unsigned chars
|
||||
if (*p < 0x20) {
|
||||
return false; // unescaped
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (*p) {
|
||||
case '"':
|
||||
|
|
Loading…
Reference in New Issue