diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-09 20:06:30 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-09 20:06:30 +0000 |
commit | c1fe19d4c1db610692365472a90f4661e48449c1 (patch) | |
tree | d0b0219ffca3c4c4256f55c4aea4513e43d6aecd /libc/stdlib/mkstemp.c | |
parent | 9efafb8bbc7408b04643dcd53825d971577b4d9d (diff) |
Bug ugly formatting update
Diffstat (limited to 'libc/stdlib/mkstemp.c')
-rw-r--r-- | libc/stdlib/mkstemp.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libc/stdlib/mkstemp.c b/libc/stdlib/mkstemp.c index de3c682b2..738952815 100644 --- a/libc/stdlib/mkstemp.c +++ b/libc/stdlib/mkstemp.c @@ -4,40 +4,40 @@ #include <fcntl.h> int mkstemp(template) -char * template; +char *template; { int i; - int num __attribute__ ((unused)); /* UNINITIALIZED */ + int num __attribute__ ((unused)); /* UNINITIALIZED */ int n2; int l = strlen(template); - - if (l<6) { + + if (l < 6) { errno = EINVAL; return -1; } - - for(i=l-6;i<l;i++) + + for (i = l - 6; i < l; i++) if (template[i] != 'X') { errno = EINVAL; return -1; } - -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; } - - i = open(template, O_RDWR|O_EXCL|O_CREAT, 0666); - - if (i==-1) { + + i = open(template, O_RDWR | O_EXCL | O_CREAT, 0666); + + if (i == -1) { if (errno == EEXIST) { num++; goto again; } else return -1; } - + return i; } |