summaryrefslogtreecommitdiffstats
path: root/lasso/xml/errors.c
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-09-17 17:35:26 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-09-17 17:35:26 +0000
commit585041d5fa8a0d9f80ba86f99792f61bfcdd5eb2 (patch)
tree0577166a2b09f1070379aab634ae4ef0d73a09ef /lasso/xml/errors.c
parent0215778ded0e5e2c9e5ef595e6ec1f6bc93c6387 (diff)
downloadlasso-585041d5fa8a0d9f80ba86f99792f61bfcdd5eb2.tar.gz
lasso-585041d5fa8a0d9f80ba86f99792f61bfcdd5eb2.tar.xz
lasso-585041d5fa8a0d9f80ba86f99792f61bfcdd5eb2.zip
use g_strdup_printf to avoir buffer size calculations and g_snprintf to avoir
buffer overrun.
Diffstat (limited to 'lasso/xml/errors.c')
-rw-r--r--lasso/xml/errors.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lasso/xml/errors.c b/lasso/xml/errors.c
index a3ee1ce0..0351cc88 100644
--- a/lasso/xml/errors.c
+++ b/lasso/xml/errors.c
@@ -30,8 +30,6 @@
const char*
lasso_strerror(int error_code)
{
- char msg[256];
-
switch (error_code) {
case LASSO_XML_ERROR_NODE_NOT_FOUND:
return "Unable to get '%s' child of '%s' element.\n";
@@ -82,7 +80,6 @@ lasso_strerror(int error_code)
return "The error return location should be either NULL or contains a NULL error.\n";
default:
- sprintf(msg, "Undefined error code %d.", error_code);
- return strdup(msg);
+ return g_strdup_printf("Undefined error code %d.", error_code);
}
}