AnsweredAssumed Answered

sscanf   problem when giving a string containg %   as the first  parameter.

Question asked by Jaime Rodriguez on Oct 26, 2009
Latest reply on Oct 29, 2009 by Petr MacHala

I need to perform the following instructions into MQX. I need to get the four ip numbers into four integers(a,b,c,d).

Problem is I am receiving %2E  as the  "."  and the "%" symbol is giving me a lot of trouble. I have tested those lines into a C compiler for PC  applications and it works fine but it fails in MQX.

 

char ip[] = "192%2E168%2E0%2E120";

sscanf(ip, "%d%%%*[2E]%d%%%*[2E]%d%%%*[2E]%d" , &a, &b, &c, &d);

 

* Function Name    : _io_sscanf
* Returned Value   : _mqx_int
* Comments         :
*   This function performs similarly to the 'C' sscanf function.
*   See scanline.c for comments.
*   The function returns the number of input items converted and assigned}

 

Where do I find scanline.c file in order to see the comments?

I need to see what does the sscanf function can do in order to get this working.

Let me know if someone knows a way around this.

 

Thanks in advanced.

Outcomes