You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/11/26 13:55:04 UTC

[GitHub] [incubator-nuttx] lukegluke opened a new issue #2406: scanf stop parse empty strings in scanset

lukegluke opened a new issue #2406:
URL: https://github.com/apache/incubator-nuttx/issues/2406


   With 350295d0098d8860ae2450bd82fdd8352bbbe98f commit in scanset conversion in lib_libvscanf.c was added:
   https://github.com/apache/incubator-nuttx/blob/b021375f2c8d86020d3f67d8dceacb24b8d67ea3/libs/libc/stdio/lib_libvscanf.c#L469-L473
   that stops on empty string.
   
   Before this I can successfully parse string:
   `0,"","",,"INITIAL"`
   with
   `sscanf(response, "%d, \"%3[^\"]\", \"%15[^\"]\", %5[^,], \"%14[^\"]\"", &index, mode, addr, port_str, state_sock)`
   it returned 5. With NuttX 10.0.0 now it stops on empty string for  \"%3[^\"]\" and returns 1 (just first %d number).
   
   At the same time there is no such condition for string conversion %s
   https://github.com/apache/incubator-nuttx/blob/b021375f2c8d86020d3f67d8dceacb24b8d67ea3/libs/libc/stdio/lib_libvscanf.c#L413
   
   Is this a bug or standard compliance?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke commented on issue #2406: scanf stop parse empty strings in scanset

Posted by GitBox <gi...@apache.org>.
lukegluke commented on issue #2406:
URL: https://github.com/apache/incubator-nuttx/issues/2406#issuecomment-735378400


   Yeah, you're right. Sorry for bothering!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke closed issue #2406: scanf stop parse empty strings in scanset

Posted by GitBox <gi...@apache.org>.
lukegluke closed issue #2406:
URL: https://github.com/apache/incubator-nuttx/issues/2406


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on issue #2406: scanf stop parse empty strings in scanset

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #2406:
URL: https://github.com/apache/incubator-nuttx/issues/2406#issuecomment-735361725


   @lukegluke why not try the same code on other OS?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org