diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-18 17:47:15 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-18 17:47:15 -0800 |
commit | e2ee9c21f0d6341e664688f30ed9cd4f49b8ab6f (patch) | |
tree | 7b42895c443715fa9a219c69a32cce1465743508 | |
parent | aa03a3b7f00c9b3697fc5c33b1febf38247450a3 (diff) |
Change sprintf calls to use snprintf instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xkbvleds.c | 2 | ||||
-rw-r--r-- | xkbwatch.c | 10 |
2 files changed, 6 insertions, 6 deletions
@@ -344,7 +344,7 @@ main(int argc, char *argv[]) char buf[12]; ArgList list; - sprintf(buf, "led%d", i + 1); + snprintf(buf, sizeof(buf), "led%d", i + 1); if (n & bit) list = onArgs; else @@ -137,34 +137,34 @@ main(int argc, char *argv[]) char buf[30]; - sprintf(buf, "base%d", i); + snprintf(buf, sizeof(buf), "base%d", i); if (state.base_mods & bit) list = onArgs; else list = offArgs; base[i] = XtCreateManagedWidget(buf, ledWidgetClass, baseBox, list, 1); - sprintf(buf, "latched%d", i); + snprintf(buf, sizeof(buf), "latched%d", i); if (state.latched_mods & bit) list = onArgs; else list = offArgs; latched[i] = XtCreateManagedWidget(buf, ledWidgetClass, latchBox, list, 1); - sprintf(buf, "locked%d", i); + snprintf(buf, sizeof(buf), "locked%d", i); if (state.locked_mods & bit) list = onArgs; else list = offArgs; locked[i] = XtCreateManagedWidget(buf, ledWidgetClass, lockBox, list, 1); - sprintf(buf, "effective%d", i); + snprintf(buf, sizeof(buf), "effective%d", i); if (state.mods & bit) list = onArgs; else list = offArgs; effective[i] = XtCreateManagedWidget(buf, ledWidgetClass, effBox, list, 1); - sprintf(buf, "compat%d", i); + snprintf(buf, sizeof(buf), "compat%d", i); if (state.compat_state & bit) list = onArgs; else |