on master help sign in
add copyright; fix indentation
commit997c1dec7d008500a792aa32a29fbf7564715792 authorwinterland1989 <winterland1989@gmail.com> dateFri 15 Jul 2016, 22:38 (10 years ago) parent2f24e55
1 file changed+7−5
cbits/unescape_string.c+7−5
cbits/unescape_string.c+7−5
@@ -1,3 +1,7 @@
1+// Copyright (c) 2008-2009 Bjoern Hoehrmann
2+// Copyright (c) 2015, Ondrej Palkovsky
3+// Copyright (c) 2016, Winterland
4+
15#include <string.h>
26#include <stdio.h>
37#include <stdint.h>
@@ -130,7 +134,7 @@ int _js_decode_string(uint16_t *const dest, size_t *destoff,
130134 if (surrogate) {
131135 if (unidata <= 0xDC00 || unidata >= 0xDFFF) // is not low surrogate
132136 return -1;
133− surrogate = 0;
137+ surrogate = 0;
134138 } else if (unidata >= 0xD800 && unidata <= 0xDBFF ) { // is high surrogate
135139 surrogate = 1;
136140 DISPATCH_ASCII(surrogate1);
@@ -139,12 +143,10 @@ int _js_decode_string(uint16_t *const dest, size_t *destoff,
139143 }
140144 goto standard;
141145 surrogate1:
142− if (codepoint != '\\')
143− return -1;
146+ if (codepoint != '\\') { return -1; }
144147 DISPATCH_ASCII(surrogate2)
145148 surrogate2:
146− if (codepoint != 'u')
147− return -1;
149+ if (codepoint != 'u') { return -1; }
148150 DISPATCH_ASCII(unicode1)
149151}
150152