Преглед на файлове

Moved buffer size check after the declarations block
Otherwise it is not a valid C code.

Kira-sempai преди 11 години
родител
ревизия
338d508e5a
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      frozen.c

+ 2 - 1
frozen.c

@@ -360,9 +360,10 @@ int json_emit_double(char *buf, int buf_len, double value) {
 }
 }
 
 
 int json_emit_quoted_str(char *buf, int buf_len, const char *str) {
 int json_emit_quoted_str(char *buf, int buf_len, const char *str) {
-  if (buf_len <= 1) return 0;
   int i = 0, j = 0, ch;
   int i = 0, j = 0, ch;
 
 
+  if (buf_len <= 1) return 0;
+
 #define EMIT(x) do { if (j < buf_len) buf[j++] = x; } while (0)
 #define EMIT(x) do { if (j < buf_len) buf[j++] = x; } while (0)
 
 
   EMIT('"');
   EMIT('"');