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.