summaryrefslogtreecommitdiff
path: root/xkbcomp.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-10-20 11:52:43 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-01 22:17:31 -0700
commit2458580ac95c550217b3376c46eecb2cca646241 (patch)
tree20285050ebc21a8068e732b3ba2be31adc5579d8 /xkbcomp.c
parent3ed68e06cb45fb526b09e4c7b7c3d60de552b2b3 (diff)
Convert remaining sprintf calls to snprintf
Most were fixed length or length checked anyway, this just saves time doublechecking that. (A few could be replaced by asprintf, but we don't have a copy guaranteed to be reachable from this program yet.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'xkbcomp.c')
-rw-r--r--xkbcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xkbcomp.c b/xkbcomp.c
index a4ee359..956e79c 100644
--- a/xkbcomp.c
+++ b/xkbcomp.c
@@ -745,7 +745,7 @@ parseArgs(int argc, char *argv[])
ACTION("Exiting\n");
exit(1);
}
- sprintf(outputFile, "stdin.%s", fileTypeExt[outputFormat]);
+ snprintf(outputFile, len, "stdin.%s", fileTypeExt[outputFormat]);
}
else if ((outputFile == NULL) && (inputFile != NULL))
{
@@ -773,7 +773,7 @@ parseArgs(int argc, char *argv[])
}
ext = strrchr(base, '.');
if (ext == NULL)
- sprintf(outputFile, "%s.%s", base, fileTypeExt[outputFormat]);
+ snprintf(outputFile, len, "%s.%s", base, fileTypeExt[outputFormat]);
else
{
strcpy(outputFile, base);