summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-09-17 16:52:48 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-09-17 16:52:48 +0000
commitbe0eb1ebcf9506277f9471671d805322779098bb (patch)
treea0e57d07f0473f7f5909e7476f347a3cc43a3d79
parent1db82e571dd29835ee669472de1a646314e12aa9 (diff)
strncpy won't add a trailing \0 to the string if it has over 512 characters;
only copy 511 and add a zero manually.
-rw-r--r--lasso/xml/debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lasso/xml/debug.c b/lasso/xml/debug.c
index 9b1d4682..5f2f8348 100644
--- a/lasso/xml/debug.c
+++ b/lasso/xml/debug.c
@@ -49,8 +49,10 @@ set_debug_info(int line,
{
debug_type = type;
debug_line = line;
- strncpy(debug_filename, filename, 512);
- strncpy(debug_function, function, 512);
+ debug_filename[511] = 0;
+ debug_function[511] = 0;
+ strncpy(debug_filename, filename, 511);
+ strncpy(debug_function, function, 511);
}
void