summaryrefslogtreecommitdiff
path: root/info.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-11-26 13:21:18 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-11-26 13:21:18 -0800
commit6f4560e2ad81736127d2d3544415a05d41e8a2a7 (patch)
tree6c53b2585d1081cf9296c09cd22acee1e9ac9a4f /info.c
parentfab9dcb15024996ac3a4f94d65ba73f484820534 (diff)
Use snprintf, strdup & remove instead of sprintf, malloc/strcpy & unlink
Diffstat (limited to 'info.c')
-rw-r--r--info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/info.c b/info.c
index f6e0b74..a560623 100644
--- a/info.c
+++ b/info.c
@@ -165,7 +165,7 @@ DisplayProps(ClientRec *client)
AppendStr (&buffer, pprop->type);
AppendStr (&buffer, "\n");
AppendStr (&buffer, "Num values: ");
- sprintf (number, "%d", ListCount (pprop->values));
+ snprintf (number, sizeof(number), "%d", ListCount (pprop->values));
AppendStr (&buffer, number);
AppendStr (&buffer, "\n");
@@ -181,7 +181,7 @@ DisplayProps(ClientRec *client)
value = *card8;
AppendStr (&buffer, "Value 1: ");
- sprintf (number, "%d", value);
+ snprintf (number, sizeof(number), "%d", value);
AppendStr (&buffer, number);
if (strcmp (pprop->name, SmRestartStyleHint) == 0)
@@ -208,7 +208,7 @@ DisplayProps(ClientRec *client)
pval = (PropValue *) pj->thing;
AppendStr (&buffer, "Value ");
- sprintf (number, "%d", propnum);
+ snprintf (number, sizeof(number), "%d", propnum);
AppendStr (&buffer, number);
AppendStr (&buffer, ": ");
AppendStr (&buffer, (char *) pval->value);