summaryrefslogtreecommitdiff
path: root/source3/utils/eventlogadm.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/eventlogadm.c')
-rw-r--r--source3/utils/eventlogadm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c
index 7fc04b008e..415330f68c 100644
--- a/source3/utils/eventlogadm.c
+++ b/source3/utils/eventlogadm.c
@@ -118,7 +118,10 @@ static int DoWriteCommand( int argc, char **argv, bool debugflag, char *exename
if (fgets( linein, sizeof( linein ) - 1, f1 ) == NULL) {
break;
}
- linein[strlen( linein ) - 1] = 0; /* whack the line delimiter */
+ if ((strlen(linein) > 0)
+ && (linein[strlen(linein)-1] == '\n')) {
+ linein[strlen(linein)-1] = 0;
+ }
if ( debugflag )
printf( "Read line [%s]\n", linein );