File tree 1 file changed +24
-24
lines changed 1 file changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -267,30 +267,30 @@ size_t Print::printFloat(double number, uint8_t digits)
267
267
268
268
size_t Print::printf (const char *format, ...)
269
269
{
270
- char loc_buf[64 ];
271
- char * temp = loc_buf;
272
- va_list arg;
273
- va_list copy;
274
- va_start (arg, format);
275
- va_copy (copy, arg);
276
- int len = vsnprintf (temp, sizeof (loc_buf), format, copy);
277
- va_end (copy);
278
- if (len < 0 ) {
279
- va_end (arg);
280
- return 0 ;
281
- };
282
- if (len >= sizeof (loc_buf)){
283
- temp = (char *) malloc (len+1 );
284
- if (temp == NULL ) {
285
- va_end (arg);
286
- return 0 ;
287
- }
288
- len = vsnprintf (temp, len+1 , format, arg);
289
- }
270
+ char loc_buf[64 ];
271
+ char * temp = loc_buf;
272
+ va_list arg;
273
+ va_list copy;
274
+ va_start (arg, format);
275
+ va_copy (copy, arg);
276
+ int len = vsnprintf (temp, sizeof (loc_buf), format, copy);
277
+ va_end (copy);
278
+ if (len < 0 ) {
290
279
va_end (arg);
291
- len = write ((uint8_t *)temp, len);
292
- if (temp != loc_buf){
293
- free (temp);
280
+ return 0 ;
281
+ }
282
+ if (len >= (int )sizeof (loc_buf)) {
283
+ temp = (char *)malloc (len + 1 );
284
+ if (temp == NULL ) {
285
+ va_end (arg);
286
+ return 0 ;
294
287
}
295
- return len;
288
+ len = vsnprintf (temp, len + 1 , format, arg);
289
+ }
290
+ va_end (arg);
291
+ len = write ((uint8_t *)temp, len);
292
+ if (temp != loc_buf) {
293
+ free (temp);
294
+ }
295
+ return len;
296
296
}
You can’t perform that action at this time.
0 commit comments