[PATCH] Bug fixes for libgsmd-tool -m shell

Holger Freyther zecke at openmoko.org
Mon Jul 21 19:09:11 CEST 2008


On Sunday 20 July 2008 02:04:08 Jorgen Cederlof wrote:
> Registering to an operator with R=xxxxx in libgsmd-tool -m shell
> results in
>
>   R=12345
>   # Unknown command `R=12345'
>
> . This has been broken since revision 3657, 2007-12-17.
>
> When fixing it I cleaned up the handling of all commands taking
> arguments, which also fixes the segfaults when too few arguments are
> given to most commands (try typing e.g. just "pr") and a problem when
> a command works even when there is trailing garbage in the command
> name (e.g. "prxxxxxxxxx=1").
>

Hey,
wow reviewing C string handling is no pleasure. From the five minute review I 
think there is only this one strncmp mistake. I would need to do a more 
careful review of all the fcomma, lcomma assignments but your patch 
definitely cleans up the handling and I will be happy to apply it once we 
talked about this one strncmp.

Have you considered using getopts of GNU to do the command line parsing?

z.




More information about the devel mailing list