Fwd: Cell_log > gsmmap
Dario Lombardo
dario.lombardo at libero.it
Tue Jan 25 16:46:29 CET 2011
On 01/25/2011 04:34 PM, Holger Hans Peter Freyther wrote:
> On 01/25/2011 04:30 PM, Dario Lombardo wrote:
>
> awesome!
>
>> + case 'g':
>> + snprintf(gps.device, 32, "%s", optarg);
>> + LOGP(DGPS, LOGL_INFO, "Using GPS device %s\n", gps.device);
> two issues there.
>
> 1.) you can use ARRAY_SIZE(gps.device) in case we ever shrink/increase this.
> In reality this should be PATH_MAX/MAX_PATH or such.
>
> 2.) snprintf will not add a '\0' of optarg is of the length of 32 or longer
>
>
Very good. This is the new patch that should fix both.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dev.diff
URL: <http://lists.osmocom.org/pipermail/baseband-devel/attachments/20110125/939229b0/attachment.txt>
More information about the baseband-devel
mailing list