Explorar o código

Fix a compiler warning

"comparing floating point with == or != is unsafe"
Richard Laager %!s(int64=15) %!d(string=hai) anos
pai
achega
fcbeab227f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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);
   }