Fix warning in time/strptime_l.c

Andreas Jaeger aj@suse.de
Sun Jan 9 09:58:00 GMT 2005


The appended patch fixes this warning:

strptime_l.c:541: warning: suggest explicit braces to avoid ambiguous ‘else’

Ok to commit?

Andreas

2005-01-09  Andreas Jaeger  <aj@suse.de>

	* time/strptime_l.c (__strptime_internal): Add braces to avoid
	warning.

============================================================
Index: time/strptime_l.c
--- time/strptime_l.c	9 Aug 2004 19:47:44 -0000	1.4
+++ time/strptime_l.c	9 Jan 2005 09:57:16 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -539,10 +539,12 @@ __strptime_internal (rp, fmt, tm, decide
 	    }
 #endif
 	  if (!match_string (HERE_AM_STR, rp))
-	    if (match_string (HERE_PM_STR, rp))
-	      is_pm = 1;
-	    else
-	      return NULL;
+	    {
+	      if (match_string (HERE_PM_STR, rp))
+		is_pm = 1;
+	      else
+		return NULL;
+	    }
 	  break;
 	case 'r':
 #ifdef _NL_CURRENT

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20050109/b7f10c7e/attachment.sig>


More information about the Libc-hacker mailing list