- char *writable_str = alloca_array(char, 10);
- sprintf(writable_str, "-%d", f->order_count);
+ const size_t order_strmax = sizeof(f->order_count)*3+2;
+ char *writable_str = alloca_array(char, order_strmax);
+ int n = snprintf(writable_str, order_strmax, "-%d", f->order_count);
+ assert(n>=0 && n < order_strmax);