File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,16 @@ static inline void fbuffer_append_char(FBuffer *fb, char newchr)
175
175
fb->len ++;
176
176
}
177
177
178
+ static inline char *fbuffer_cursor (FBuffer *fb)
179
+ {
180
+ return fb->ptr + fb->len ;
181
+ }
182
+
183
+ static inline void fbuffer_advance_to (FBuffer *fb, char *end)
184
+ {
185
+ fb->len = end - fb->ptr ;
186
+ }
187
+
178
188
/*
179
189
* Appends the decimal string representation of \a number into the buffer.
180
190
*/
@@ -205,9 +215,8 @@ static void fbuffer_append_long(FBuffer *fb, long number)
205
215
number = -number;
206
216
}
207
217
208
- char * d = fb->ptr + fb->len ;
209
- char * end = jeaiii_ultoa (d, number);
210
- fb->len += end - d;
218
+ char *end = jeaiii_ultoa (fbuffer_cursor (fb), number);
219
+ fbuffer_advance_to (fb, end);
211
220
}
212
221
213
222
static VALUE fbuffer_finalize (FBuffer *fb)
You can’t perform that action at this time.
0 commit comments