summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-18 17:47:15 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-18 17:47:15 -0800
commite2ee9c21f0d6341e664688f30ed9cd4f49b8ab6f (patch)
tree7b42895c443715fa9a219c69a32cce1465743508
parentaa03a3b7f00c9b3697fc5c33b1febf38247450a3 (diff)
Change sprintf calls to use snprintf instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xkbvleds.c2
-rw-r--r--xkbwatch.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/xkbvleds.c b/xkbvleds.c
index 03745fb..b80ec49 100644
--- a/xkbvleds.c
+++ b/xkbvleds.c
@@ -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
diff --git a/xkbwatch.c b/xkbwatch.c
index 4a71d28..0502a15 100644
--- a/xkbwatch.c
+++ b/xkbwatch.c
@@ -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