diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
commit | a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (patch) | |
tree | b88cc7a8457658d67e0321718556ac807f6bccf3 /src/auto-str.c | |
parent | 00be7622c428f279872f84569f098ce16150f8a8 (diff) |
format files
Diffstat (limited to 'src/auto-str.c')
-rw-r--r-- | src/auto-str.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/auto-str.c b/src/auto-str.c index 72e93bd..cad14ce 100644 --- a/src/auto-str.c +++ b/src/auto-str.c @@ -1,13 +1,14 @@ #include <unistd.h> + #include "buffer.h" #include "exit.h" char inbuf[BUFFER_SMALL]; -buffer b = BUFFER_INIT(write,1,inbuf,sizeof(inbuf)); +buffer b = BUFFER_INIT(write, 1, inbuf, sizeof(inbuf)); void out(char *s) { - if (buffer_puts(&b,s) == -1) _exit(111); + if (buffer_puts(&b, s) == -1) _exit(111); } int main(int argc, char **argv) @@ -29,8 +30,10 @@ int main(int argc, char **argv) while ((ch = *value++)) { out("\\"); octal[3] = 0; - octal[2] = '0' + (ch & 7); ch >>= 3; - octal[1] = '0' + (ch & 7); ch >>= 3; + octal[2] = '0' + (ch & 7); + ch >>= 3; + octal[1] = '0' + (ch & 7); + ch >>= 3; octal[0] = '0' + (ch & 7); out(octal); } |