Sfoglia il codice sorgente

Fix a compiler warning

"comparing floating point with == or != is unsafe"
Richard Laager 15 anni fa
parent
commit
fcbeab227f
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/docsis_encode.c

+ 1 - 1
src/docsis_encode.c

@@ -334,7 +334,7 @@ int encode_hexstr (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr)
   helper = (union t_val *) tval;
   string_size = strlen ( helper->strval );
 
-  if ( string_size != 2*floor(string_size/2) ) {
+  if ( string_size % 2 != 0 ) {
         printf ("encode_hexstr: invalid hex string !\n");
         exit (-1);
   }