summaryrefslogtreecommitdiff
path: root/geometry.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-05-09 11:19:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-05-09 11:19:33 -0700
commitaf90a105ec97c6d856d2e8a80e8822c3e192d1e9 (patch)
tree88e8a1428621f6dd10eb7c37370723d2e6a1b7e8 /geometry.c
parent9ffefd5b3d38e9ed2b5ed59bc50e8a7da761fb77 (diff)
Replace remaining sprintf calls with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'geometry.c')
-rw-r--r--geometry.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/geometry.c b/geometry.c
index 8f3adea..0bc9445 100644
--- a/geometry.c
+++ b/geometry.c
@@ -63,7 +63,7 @@ _FindWidget(Widget w)
Window win;
int x, y; /* location of event in root coordinates. */
- sprintf(msg, res_labels[14]);
+ snprintf(msg, sizeof(msg), res_labels[14]);
SetMessage(global_screen_data.info_label, msg);
@@ -103,7 +103,7 @@ DisplayChild(Event *event)
find_event->widgets.num_widgets);
if (node == NULL) {
- sprintf(msg, res_labels[13]);
+ snprintf(msg, sizeof(msg), res_labels[13]);
SetMessage(global_screen_data.info_label, msg);
return;
}
@@ -112,7 +112,7 @@ DisplayChild(Event *event)
node = node->tree_info->top_node;
- sprintf(msg, res_labels[12], node->name, node->class);
+ snprintf(msg, sizeof(msg), res_labels[12], node->name, node->class);
SetMessage(global_screen_data.info_label, msg);
_FlashActiveWidgets(global_tree_info);
@@ -193,7 +193,8 @@ AddToFlashList(TreeInfo *tree_info, GetGeomInfo *geom_info, char **errors)
geom_info->widgets.ids, geom_info->widgets.num_widgets);
if (node == NULL) {
- sprintf(buf, "Editres Internal Error: Unable to FindNode.\n");
+ snprintf(buf, sizeof(buf),
+ "Editres Internal Error: Unable to FindNode.\n");
AddString(errors, buf);
return;
}
@@ -204,7 +205,7 @@ AddToFlashList(TreeInfo *tree_info, GetGeomInfo *geom_info, char **errors)
}
if (!geom_info->visable) {
- sprintf(buf, "%s(0x%lx) - This widget is not mapped\n",
+ snprintf(buf, sizeof(buf), "%s(0x%lx) - This widget is not mapped\n",
node->name, node->id);
AddString(errors, buf);
return;
@@ -240,11 +241,13 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
char buf[BUFSIZ];
if (node->window == EDITRES_IS_OBJECT)
- sprintf(buf, "%s(0x%lx) - This object's parent is unrealized\n",
- node->name, node->id);
+ snprintf(buf, sizeof(buf),
+ "%s(0x%lx) - This object's parent is unrealized\n",
+ node->name, node->id);
else
- sprintf(buf, "%s(0x%lx) - This widget is unrealized\n",
- node->name, node->id);
+ snprintf(buf, sizeof(buf),
+ "%s(0x%lx) - This widget is unrealized\n",
+ node->name, node->id);
AddString(errors, buf);
return;
@@ -261,8 +264,9 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
if (global_error_code == NO_WINDOW) {
char buf[BUFSIZ];
- sprintf(buf, "%s(0x%lx) - This widget's window no longer exists.\n",
- node->name, node->id);
+ snprintf(buf, sizeof(buf),
+ "%s(0x%lx) - This widget's window no longer exists.\n",
+ node->name, node->id);
AddString(errors, buf);
return;
}
@@ -270,8 +274,8 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
if (attrs.map_state != IsViewable) {
char buf[BUFSIZ];
- sprintf(buf, "%s(0x%lx) - This widget is not mapped.\n",
- node->name, node->id);
+ snprintf(buf, sizeof(buf), "%s(0x%lx) - This widget is not mapped.\n",
+ node->name, node->id);
AddString(errors, buf);
return;
}