Skip to content

Commit bde1ee9

Browse files
authored
Merge branch 'master' into patch-1
2 parents 0eed112 + 63cc948 commit bde1ee9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

json-maker.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@ static int nibbletoch( int nibble ) {
107107
* @param ch Character source.
108108
* @return The escape character or null character if error. */
109109
static int escape( int ch ) {
110+
int i;
110111
static struct { char code; char ch; } const pair[] = {
111112
{ '\"', '\"' }, { '\\', '\\' }, { '/', '/' }, { 'b', '\b' },
112113
{ 'f', '\f' }, { 'n', '\n' }, { 'r', '\r' }, { 't', '\t' },
113114
};
114-
for( int i = 0; i < sizeof pair / sizeof *pair; ++i )
115+
for( i = 0; i < sizeof pair / sizeof *pair; ++i )
115116
if ( ch == pair[i].ch )
116117
return pair[i].code;
117118
return '\0';
@@ -123,7 +124,8 @@ static int escape( int ch ) {
123124
* @param len Max length of source. < 0 for unlimit.
124125
* @return Pointer to the null character of the destination string. */
125126
static char* atoesc( char* dest, char const* src, int len ) {
126-
for( int i = 0; src[i] != '\0' && ( i < len || 0 > len ); ++dest, ++i ) {
127+
int i;
128+
for( i = 0; src[i] != '\0' && ( i < len || 0 > len ); ++dest, ++i ) {
127129
if ( src[i] >= ' ' && src[i] != '\"' && src[i] != '\\' && src[i] != '/' )
128130
*dest = src[i];
129131
else {
@@ -275,4 +277,4 @@ ALL_TYPES
275277
#undef X
276278

277279

278-
#endif
280+
#endif

0 commit comments

Comments
 (0)