summaryrefslogtreecommitdiff
path: root/xstdcmap.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-13 12:35:40 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-13 12:35:40 -0800
commitc6f15b6d67f4c8df2af07848d6277593e24f6352 (patch)
tree9d60f19096560cf15557345440d685c6dcf784dc /xstdcmap.c
parent06186d82c57b2545db2d6b1a6665f23d1b6a3cfd (diff)
Replace sprintf with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xstdcmap.c')
-rw-r--r--xstdcmap.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/xstdcmap.c b/xstdcmap.c
index 0e73158..9ba2a84 100644
--- a/xstdcmap.c
+++ b/xstdcmap.c
@@ -126,23 +126,23 @@ parse(int argc, char **argv)
if (--argc)
usage(1);
- (void) sprintf(option, "%s%s", program_name, ".all");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".all");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
all++;
- (void) sprintf(option, "%s%s", program_name, ".best");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".best");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
propertyTable[BEST].create++;
- (void) sprintf(option, "%s%s", program_name, ".blue");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".blue");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
propertyTable[BLUE].create++;
- (void) sprintf(option, "%s%s", program_name, ".default");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".default");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
propertyTable[DEFAULT].create++;
- (void) sprintf(option, "%s%s", program_name, ".delete");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".delete");
if (XrmGetResource(database, option, (char *) NULL, &type, &value)) {
register int i;
for (i=0; i < NPROPERTIES; i++) {
@@ -155,27 +155,27 @@ parse(int argc, char **argv)
}
}
- (void) sprintf(option, "%s%s", program_name, ".display");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".display");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
display_name = value.addr;
- (void) sprintf(option, "%s%s", program_name, ".gray");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".gray");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
propertyTable[GRAY].create++;
- (void) sprintf(option, "%s%s", program_name, ".green");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".green");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
propertyTable[GREEN].create++;
- (void) sprintf(option, "%s%s", program_name, ".help");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".help");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
help++;
- (void) sprintf(option, "%s%s", program_name, ".red");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".red");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
propertyTable[RED].create++;
- (void) sprintf(option, "%s%s", program_name, ".verbose");
+ snprintf(option, sizeof(option), "%s%s", program_name, ".verbose");
if (XrmGetResource(database, option, (char *) NULL, &type, &value))
verbose++;
}