From 354ece393aeb22bc8fecaa8b0ef7cba5b390b79f Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Thu, 2 Nov 2006 18:02:17 +0000 Subject: There is no need to trim an empty string any further, just return it. OK moritz@. --- usr.bin/encrypt/encrypt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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; -- cgit v1.2.3