screenlock: set max field width for sprintf

Stop a compiler warning about overwriting the 100 char buffer with larger
string.

programs/sxmo_screenlock.c:61:3: note: ‘sprintf’ output between 39 and 294 bytes into a destination of size 100
master
Serge E. Hallyn 4 years ago committed by Miles Alan
parent 2cec0fc3be
commit 5a4ce877df
  1. 2
      programs/sxmo_screenlock.c

@ -60,7 +60,7 @@ configuresuspendsettingsandwakeupsources()
while ((wakeupsource = readdir(wakeupsources)) != NULL) { while ((wakeupsource = readdir(wakeupsources)) != NULL) {
sprintf( sprintf(
wakeuppath, wakeuppath,
"/sys/class/wakeup/%s/device/power/wakeup", "/sys/class/wakeup/%.50s/device/power/wakeup",
wakeupsource->d_name wakeupsource->d_name
); );
fprintf(stderr, "Disabling wakeup source: %s", wakeupsource->d_name); fprintf(stderr, "Disabling wakeup source: %s", wakeupsource->d_name);

Loading…
Cancel
Save