aboutsummaryrefslogtreecommitdiffstats
path: root/mkstemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkstemp.c')
-rw-r--r--mkstemp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mkstemp.c b/mkstemp.c
index bc20510634..a1041e7648 100644
--- a/mkstemp.c
+++ b/mkstemp.c
@@ -41,6 +41,8 @@
#include <process.h> /* For spawning child process */
#endif
+#include <glib.h>
+
#ifndef __set_errno
#define __set_errno(x) errno=(x)
#endif
@@ -65,7 +67,7 @@ mkstemp (template)
return -1;
}
- if (sprintf (&template[len - 5], "%.5u",
+ if (g_snprintf (&template[len - 5], 6, "%.5u",
(unsigned int) getpid () % 100000) != 5)
/* Inconceivable lossage. */
return -1;