Hello,
I work with LPC2148 and RealView Compiler.
I have noticed that if I convert a string with the atoi function, the result never is correct. If the value of the number in the string is inferior to 20 the result is 0. If the value of the number is great of 20 the result is equal to the number subtracted to 20.
Example 1:
char sbuffer[] = "12"; int buffer; buffer = atoi(sbuffer); //now buffer = 0 (I waited for 12).
Example 2:
char sbuffer[] = "29"; int buffer; buffer = atoi(sbuffer); //now buffer = 9 (I waited for 29).
Probably the problem is with strtol (function used by atoi), perhaps with the number base? But the number base of strtol is not automatic with atoi?
Is there some suggestion? Thank you.
M.
I had problems with toupper and others also. My sugestion : Write your own function or wait untill it is'fixed by a new release.
Hi Viktor, thank you for your replay. This bugs are unbelievable...
If it is not a problem, can you tell me the complete list of the functions with bugs that you have found?
In this way I could know what to modify...
Thank you