Fwd: Cell_log > gsmmap

Holger Hans Peter Freyther holger at freyther.de
Tue Jan 25 15:34:32 UTC 2011


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





More information about the baseband-devel mailing list