/* TODO: try to avoid the use of heap */ SDB_VISIBLE char *sdb_itoa(ut64 n, char *s) { int i = 0; if (!s) s = malloc (64); do s[i++] = n % 10 + '0'; while ((n /= 10) > 0); s[i] = '\0'; __strrev (s, i); return s; }
R_API char *sdb_itoa(ut64 n, char *s) { int i = 0; if (!s) s = malloc (64); do s[i++] = n % 10 + '0'; while ((n /= 10) > 0); s[i] = '\0'; __strrev (s, i); // TODO find an algo without strrev return s; }