summaryrefslogtreecommitdiff
path: root/libc/stdlib/mktemp.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-09 20:06:30 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-09 20:06:30 +0000
commitc1fe19d4c1db610692365472a90f4661e48449c1 (patch)
treed0b0219ffca3c4c4256f55c4aea4513e43d6aecd /libc/stdlib/mktemp.c
parent9efafb8bbc7408b04643dcd53825d971577b4d9d (diff)
Bug ugly formatting update
Diffstat (limited to 'libc/stdlib/mktemp.c')
-rw-r--r--libc/stdlib/mktemp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libc/stdlib/mktemp.c b/libc/stdlib/mktemp.c
index bbe589efc..cfdcf0913 100644
--- a/libc/stdlib/mktemp.c
+++ b/libc/stdlib/mktemp.c
@@ -4,37 +4,37 @@
#include <fcntl.h>
#include <sys/stat.h>
-char * mktemp(template)
-char * template;
+char *mktemp(template)
+char *template;
{
int i;
- int num __attribute__ ((unused)); /* UNINITIALIZED */
+ int num __attribute__ ((unused)); /* UNINITIALIZED */
int n2;
int l = strlen(template);
struct stat stbuf;
-
- if (l<6) {
+
+ if (l < 6) {
errno = EINVAL;
return 0;
}
-
- for(i=l-6;i<l;i++)
+
+ for (i = l - 6; i < l; i++)
if (template[i] != 'X') {
errno = EINVAL;
return 0;
}
-
-again:
+
+ again:
n2 = num;
- for(i=l-1;i>=l-6;i--) {
+ for (i = l - 1; i >= l - 6; i--) {
template[i] = '0' + n2 % 10;
n2 /= 10;
}
-
+
if (stat(template, &stbuf) == 0) {
num++;
goto again;
}
-
+
return template;
}