Kaynağa Gözat

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

Kira-sempai 11 yıl önce
ebeveyn
işleme
338d508e5a
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  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) {
-  if (buf_len <= 1) return 0;
   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)
 
   EMIT('"');