Gentoo Archives: gentoo-dev

From: Matthew Dillon <dillon@××××××××××××××××.com>
To: Christian HOFFMANN <christian.hoffmann@××××.fr>
Cc: gentoo-dev@g.o
Subject: [gentoo-dev] Re: [BUG and PATCH] Does dcron need a space at the end of each
Date: Wed, 20 Mar 2002 20:16:54
Message-Id: 200203210212.g2L2Cxw87510@apollo.backplane.com
In Reply to: [gentoo-dev] [BUG and PATCH] Does dcron need a space at the end of each by Christian HOFFMANN
1 :I just fired gdb to find the source of this problem and found the source
2 :of the problem being at line 178 of database.c
3 :
4 :was: buf[strlen(ptr)-1] = 0;
5 :is now on my system: buf[strlen(ptr)] = 0;
6 :
7 :This line was chopping 2 char at the end of the line the last one of the
8 :command and the newline. You have to remove one char but indexing
9 :starts at 0 and strlen give the number of char.
10 :
11 :I'm new to patch submission, howto ?
12 :
13 :Regards
14
15 Well, I do not know who is maintaining the linux version of dcron.
16 I maintain my master source but I don't think the linux sites are
17 picking it up.
18
19 In regards to this bug, I think the problem is that it should be
20 'ptr[strlen(ptr)-1] = 0' rather then 'buf[strlen(ptr)-1] = 0'.
21 That is, it is trying to remove the newline at the end of the
22 buffer. The bug occurs if you have spaces at the front of the line.
23
24 Please try 'ptr[strlen(ptr)-1] = 0' and see if that solves your
25 problem.
26
27 -Matt

Replies

Subject Author
Re: [gentoo-dev] Re: [BUG and PATCH] Does dcron need a space at the end of each Christian HOFFMANN <christian.hoffmann@××××.fr>