Sat Aug 28 20:52:55 2010 UTC ()
don't return an int casted pointer as 'boolean' value - compare result of strchr with NULL


(kardel)
diff -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c

cvs diff -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c (expand / switch to unified diff)

--- src/external/bsd/ntp/dist/ntpd/ntp_scanner.c 2009/12/13 16:56:14 1.1.1.1
+++ src/external/bsd/ntp/dist/ntpd/ntp_scanner.c 2010/08/28 20:52:55 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ntp_scanner.c,v 1.1.1.1 2009/12/13 16:56:14 kardel Exp $ */ 1/* $NetBSD: ntp_scanner.c,v 1.2 2010/08/28 20:52:55 kardel Exp $ */
2 2
3 3
4/* ntp_scanner.c 4/* ntp_scanner.c
5 * 5 *
6 * The source code for a simple lexical analyzer.  6 * The source code for a simple lexical analyzer.
7 * 7 *
8 * Written By: Sachin Kamboj 8 * Written By: Sachin Kamboj
9 * University of Delaware 9 * University of Delaware
10 * Newark, DE 19711 10 * Newark, DE 19711
11 * Copyright (c) 2006 11 * Copyright (c) 2006
12 */ 12 */
13 13
14#ifdef HAVE_CONFIG_H 14#ifdef HAVE_CONFIG_H
@@ -343,27 +343,27 @@ is_double( @@ -343,27 +343,27 @@ is_double(
343 if (!lexeme[i]) 343 if (!lexeme[i])
344 return 1; 344 return 1;
345 else 345 else
346 return 0; 346 return 0;
347} 347}
348 348
349 349
350/* is_special() - Test whether a character is a token */ 350/* is_special() - Test whether a character is a token */
351static inline int 351static inline int
352is_special( 352is_special(
353 int ch 353 int ch
354 ) 354 )
355{ 355{
356 return (int)strchr(special_chars, ch); 356 return strchr(special_chars, ch) != NULL;
357} 357}
358 358
359 359
360static int 360static int
361is_EOC( 361is_EOC(
362 int ch 362 int ch
363 ) 363 )
364{ 364{
365 if ((old_config_style && (ch == '\n')) || 365 if ((old_config_style && (ch == '\n')) ||
366 (!old_config_style && (ch == ';'))) 366 (!old_config_style && (ch == ';')))
367 return 1; 367 return 1;
368 return 0; 368 return 0;
369} 369}