summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beutil.h
diff options
context:
space:
mode:
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>2006-06-21 19:46:15 +0200
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>2006-06-21 19:46:15 +0200
commita51b19f667731104d1277df71b26daa2d3816189 (patch)
tree2a8ef136b4cec97a112922612a641b6606ce1270 /ir/be/beutil.h
parent3b3593fc03cc8b39674fe4ed87f8514037fe700c (diff)
make sure a '\0' is at the end of an snprintf'ed string
Diffstat (limited to 'ir/be/beutil.h')
-rw-r--r--ir/be/beutil.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ir/be/beutil.h b/ir/be/beutil.h
index d1b1eb0..ae193f5 100644
--- a/ir/be/beutil.h
+++ b/ir/be/beutil.h
@@ -87,6 +87,7 @@ static INLINE FILE *ffopen(const char *base, const char *ext, const char *mode)
char buf[1024];
snprintf(buf, sizeof(buf), "%s.%s", base, ext);
+ buf[sizeof(buf) - 1] = '\0';
if (! (out = fopen(buf, mode))) {
fprintf(stderr, "Cannot open file %s in mode %s\n", buf, mode);
return NULL;