sprinkle compiler attributes over code base
some arm fixes (char is unsigned on arm)
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,5 +1,7 @@
|
||||
0.35:
|
||||
add clamp.h (for easy integer overflow prevention)
|
||||
sprinkle compiler attributes over code base
|
||||
some arm fixes (char is unsigned on arm)
|
||||
|
||||
0.34:
|
||||
be more C99 compliant (Florian Weimer)
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
#define __builtin_constant_p(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef __dietlibc__
|
||||
#if defined(__GNUC__)
|
||||
#if __has_attribute(null_terminated_string_arg)
|
||||
// Function arguments.
|
||||
@@ -208,5 +209,6 @@
|
||||
|
||||
#endif
|
||||
#endif // !defined(__GNUC__)
|
||||
#endif // !defined(__dietlibc__
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stddef.h>
|
||||
#include "compiler.h"
|
||||
#undef __dietlibc__
|
||||
#include "str.h"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ size_t scan_jsonescape(const char *src,char *dest,size_t *destlen) {
|
||||
size_t j;
|
||||
unsigned int cur;
|
||||
for (cur=j=0; j<4; ++j) {
|
||||
char x=scan_fromhex(s[i+2+j]);
|
||||
signed char x=scan_fromhex(s[i+2+j]);
|
||||
if (x<0) goto abort; // not hex -> invalid input
|
||||
cur=(cur<<4) | x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user