Esempio n. 1
0
/* 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;
}
Esempio n. 2
0
File: sdbn.c Progetto: eddyb/radare2
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;
}