diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-11-02 18:02:17 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-11-02 18:02:17 +0000 |
commit | 354ece393aeb22bc8fecaa8b0ef7cba5b390b79f (patch) | |
tree | 7a30195033819da33b11fdb1eefa8efc7d12394e | |
parent | 13281731239c50b4d7499ae5fe1fad87bc286403 (diff) |
There is no need to trim an empty string any further, just return
it.
OK moritz@.
-rw-r--r-- | usr.bin/encrypt/encrypt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/encrypt/encrypt.c b/usr.bin/encrypt/encrypt.c index d5aa4d3c625..67221a4dae2 100644 --- a/usr.bin/encrypt/encrypt.c +++ b/usr.bin/encrypt/encrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: encrypt.c,v 1.23 2006/05/27 23:42:08 moritz Exp $ */ +/* $OpenBSD: encrypt.c,v 1.24 2006/11/02 18:02:16 ray Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -68,6 +68,9 @@ trim(char *line) { char *ptr; + if (line[0] == '\0') + return (line); + for (ptr = &line[strlen(line)-1]; ptr > line; ptr--) { if (!isspace(*ptr)) break; |