for comparison, a snippet of the 706-line gnu version Afficher plus
static voidincr (char **s0, size_t *s_len){ char *s = *s0; char *endp = s + *s_len - 1;
do { if ((*endp)++ < '9') return; *endp-- = '0'; } while (endp >= s); *--(*s0) = '1'; ++*s_len;}