ARM C++ problem with atoi() function

Sysprogs forums Forums VisualGDB ARM C++ problem with atoi() function

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23233
    maras
    Participant

    I think this is not strict VisualGDB problem, but I will explain it here, maybe someone know solution.
    In my application I use atoi() function to convert string from MQTT message to integer. Argument string is always “0” or “1” but the result of conversion sometimes is 255 one or two times i see result = 243.

    
    char result;
    result = atoi(message.getValue());
    printf("Result string = %s\r\n", message.getValue());
    printf("Result value = %d\r\n", result);
    

    Sometimes i see:

    Result string = 1
    Result value = 255

    or

    Result string = 0
    Result value = 255

    When I pritf all MQTT message I also see that value is correct, so I think that only reasone of my problems is atoi() malfunction, but I don’t know why.

    I have similar problem with atof() but I think if I resolve atoi() problem. I will resolve also atof().
    Regards, Marek

    #23234
    support
    Keymaster

    Hi,

    Sorry, the atoi() function is indeed not a part of VisualGDB. Please consider submitting a bug report to the bugtracker of the C library you are using.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.