Next time please tell us the error so people that want to help you don't have to guess.
If your array is 32 large it only fits 31 characters because you need to include the null terminator at the end of the string. You need to use 31 and 1 as your array size parameters for
get_user_name and
num_to_str (and the
temp2 array is therefore too small to hold your double digit integers). Please use the
charsmax macro to avoid simple mistakes like this in the future:
PHP Code:
get_user_name(i,temp1, charsmax(temp1));
num_to_str(i,temp2, charsmax(temp2));
charsmax(variable) expands to
sizeof(variable)-1 and will always give you the correct integer to pass into string handling functions.
__________________