On Tuesday 24 May 2011 13:15:37 Jim Meyering wrote:
> I did not try to see if fixing this bug changes how patch works.
It doesn't as far as I can see. It doesn't fix a real bug either, but avoids
a static checker error (so it's a good thing). I'd rather initialize stamp
completely at the top of the function though, like this:
diff --git a/src/util.c b/src/util.c
index 6950842..75486f4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1428,6 +1428,7 @@ fetchname (char const *at, int strip_leading, bool
maybe_quoted, char **pname,
struct timespec stamp;
stamp.tv_sec = -1;
+ stamp.tv_nsec = 0;
while (ISSPACE ((unsigned char) *at))
at++;
@@ -1497,9 +1498,7 @@ fetchname (char const *at, int strip_leading, bool
maybe_quoted, char **pname,
timestr[u - t] = 0;
}
- if (*t == '\n')
- stamp.tv_sec = -1;
- else
+ if (*t != '\n')
{
if (! pstamp)
{
--
Okay?
Andreas