summaryrefslogtreecommitdiff
path: root/src/maprules.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-10-20 12:04:58 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-10-28 20:29:29 -0700
commit390acfe5bb88cdab509b5eaae4041f265e969d2b (patch)
tree1b8ef39e473698f3cb3e76f75bde382cf851f621 /src/maprules.c
parent455c2f3715456fd88c2741bd2028a9f0a702bb28 (diff)
downloadxorg-lib-libxkbfile-390acfe5bb88cdab509b5eaae4041f265e969d2b.tar.gz
Convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/maprules.c')
-rw-r--r--src/maprules.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/maprules.c b/src/maprules.c
index f0c39b3..d42b105 100644
--- a/src/maprules.c
+++ b/src/maprules.c
@@ -1032,7 +1032,7 @@ XkbRF_LoadRulesByName(char *base, char *locale, XkbRF_RulesPtr rules)
if (locale) {
if (strlen(base) + strlen(locale) + 2 > PATH_MAX)
return False;
- sprintf(buf, "%s-%s", base, locale);
+ snprintf(buf, sizeof(buf), "%s-%s", base, locale);
}
else {
if (strlen(base) + 1 > PATH_MAX)
@@ -1237,17 +1237,17 @@ XkbRF_LoadDescriptionsByName(char *base, char *locale, XkbRF_RulesPtr rules)
if (locale) {
if (strlen(base) + strlen(locale) + 6 > PATH_MAX)
return False;
- sprintf(buf, "%s-%s.lst", base, locale);
+ snprintf(buf, sizeof(buf), "%s-%s.lst", base, locale);
}
else {
if (strlen(base) + 5 > PATH_MAX)
return False;
- sprintf(buf, "%s.lst", base);
+ snprintf(buf, sizeof(buf), "%s.lst", base);
}
file = fopen(buf, "r");
if ((!file) && (locale)) { /* fallback if locale was specified */
- sprintf(buf, "%s.lst", base);
+ snprintf(buf, sizeof(buf), "%s.lst", base);
file = fopen(buf, "r");
}