Sfoglia il codice sorgente

Drop exclamation points from error messages

Richard Laager 13 anni fa
parent
commit
448afcb34d
4 ha cambiato i file con 35 aggiunte e 35 eliminazioni
  1. 1 1
      src/docsis.c
  2. 7 7
      src/docsis_decode.c
  3. 25 25
      src/docsis_encode.c
  4. 2 2
      src/docsis_yy.y

+ 1 - 1
src/docsis.c

@@ -364,7 +364,7 @@ init_global_symtable (void)
     (symbol_type *) malloc (sizeof (symbol_type) * NUM_IDENTIFIERS);
   if (global_symtable == NULL)
     {
-      fprintf(stderr, "Error allocating memory!\n");
+      fprintf(stderr, "Error allocating memory\n");
       exit (255);
     }
   memcpy (global_symtable, symtable, sizeof (symbol_type) * NUM_IDENTIFIERS);

+ 7 - 7
src/docsis_decode.c

@@ -54,7 +54,7 @@ void decode_uint (unsigned char *tlvbuf, struct symbol_entry *sym, size_t length
 {
   static unsigned int helper;
   if (length != sizeof(unsigned int) ) {
-	fprintf(stderr, "u_int length mismatch!\n");
+	fprintf(stderr, "u_int length mismatch\n");
 	exit(-45);
   }
   memset( &helper, 0, sizeof(unsigned int));
@@ -67,7 +67,7 @@ void decode_ushort (unsigned char *tlvbuf, symbol_type *sym, size_t length)
 {
   static unsigned short helper;
   if (length != sizeof(unsigned short) ) {
-        fprintf(stderr, "u_short length mismatch!\n");
+        fprintf(stderr, "u_short length mismatch\n");
         exit(-45);
   }
 
@@ -86,7 +86,7 @@ void decode_ip (unsigned char *tlvbuf, symbol_type *sym, size_t length )
 {
   static struct in_addr helper;
   if (length != sizeof(struct in_addr) ) {
-        fprintf(stderr, "ip address length mismatch!\n");
+        fprintf(stderr, "ip address length mismatch\n");
         exit(-45);
   }
 
@@ -100,7 +100,7 @@ void decode_ip6 (unsigned char *tlvbuf, symbol_type *sym, size_t length )
   static struct in6_addr helper;
   char ipstr[INET6_ADDRSTRLEN];
   if (length != sizeof(struct in6_addr) ) {
-        fprintf(stderr, "ip address length mismatch!\n");
+        fprintf(stderr, "ip address length mismatch\n");
         exit(-45);
   }
 
@@ -113,7 +113,7 @@ void decode_ether (unsigned char *tlvbuf, symbol_type *sym, size_t length )
 {
 
  if (length != 6 ) {
-        fprintf(stderr, "ethermac length mismatch!\n");
+        fprintf(stderr, "ethermac length mismatch\n");
         exit(-45);
  }
  printf("%s %s;\n",
@@ -127,7 +127,7 @@ void decode_ethermask (unsigned char *tlvbuf, symbol_type *sym, size_t length)
  * "passees" to avoid the 2nd call overwriting the 1st.
  */
   if (length != 12 ) {
-        fprintf(stderr, "ethermac_and_mask length mismatch!\n");
+        fprintf(stderr, "ethermac_and_mask length mismatch\n");
         exit(-45);
   }
   printf("%s %s/", sym->sym_ident, ether_ntoa(tlvbuf));
@@ -139,7 +139,7 @@ void decode_md5 (unsigned char *tlvbuf, symbol_type *sym, size_t length)
 {
   size_t j=0;
   if (length != 16 ) {
-        fprintf(stderr, "md5digest length mismatch!\n");
+        fprintf(stderr, "md5digest length mismatch\n");
         exit(-45);
   }
 

+ 25 - 25
src/docsis_encode.c

@@ -47,12 +47,12 @@ int encode_uint ( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr )
   unsigned int int_value;
   union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
   if ( buf == NULL ) {
-	fprintf(stderr, "encode_uint called w/NULL buffer!\n");
+	fprintf(stderr, "encode_uint called w/NULL buffer\n");
 	exit (-1);
   }
 
   if ( tval == NULL  ) {
-	fprintf(stderr, "encode_uint called w/NULL value struct !\n");
+	fprintf(stderr, "encode_uint called w/NULL value struct\n");
 	exit (-1);
   }
   helper = (union t_val *) tval;
@@ -76,12 +76,12 @@ int encode_ushort ( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr
   unsigned short sint;
   union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_ushort called w/NULL buffer!\n");
+        fprintf(stderr, "encode_ushort called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_ushort called w/NULL value struct !\n");
+        fprintf(stderr, "encode_ushort called w/NULL value struct\n");
         exit (-1);
   }
   helper = (union t_val *) tval;
@@ -105,12 +105,12 @@ int encode_uchar ( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr
   char *cp;
   union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_uchar called w/NULL buffer!\n");
+        fprintf(stderr, "encode_uchar called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_uchar called w/NULL value struct !\n");
+        fprintf(stderr, "encode_uchar called w/NULL value struct\n");
         exit (-1);
   }
 
@@ -139,12 +139,12 @@ int encode_ip( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr )
   union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_ip called w/NULL buffer!\n");
+        fprintf(stderr, "encode_ip called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_ip called w/NULL value struct !\n");
+        fprintf(stderr, "encode_ip called w/NULL value struct\n");
         exit (-1);
   }
 
@@ -168,12 +168,12 @@ int encode_ip6( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr )
   union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_ip called w/NULL buffer!\n");
+        fprintf(stderr, "encode_ip called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_ip called w/NULL value struct !\n");
+        fprintf(stderr, "encode_ip called w/NULL value struct\n");
         exit (-1);
   }
 
@@ -197,12 +197,12 @@ int retval; 	     /* return value of inet_aton */
 union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_ether called w/NULL buffer!\n");
+        fprintf(stderr, "encode_ether called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_ether called w/NULL value struct !\n");
+        fprintf(stderr, "encode_ether called w/NULL value struct\n");
         exit (-1);
   }
 
@@ -226,12 +226,12 @@ char *ether,*mask;
 union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_ethermask called w/NULL buffer!\n");
+        fprintf(stderr, "encode_ethermask called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_ethermask called w/NULL value struct !\n");
+        fprintf(stderr, "encode_ethermask called w/NULL value struct\n");
         exit (-1);
   }
 
@@ -268,12 +268,12 @@ int encode_string(unsigned char *buf, void *tval, struct symbol_entry *sym_ptr )
   union t_val *helper;
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_string called w/NULL buffer!\n");
+        fprintf(stderr, "encode_string called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_string called w/NULL value struct !\n");
+        fprintf(stderr, "encode_string called w/NULL value struct\n");
         exit (-1);
   }
   helper = (union t_val *) tval;
@@ -309,12 +309,12 @@ int encode_strzero(unsigned char *buf, void *tval, struct symbol_entry *sym_ptr
   union t_val *helper;
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_string called w/NULL buffer!\n");
+        fprintf(stderr, "encode_string called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_string called w/NULL value struct !\n");
+        fprintf(stderr, "encode_string called w/NULL value struct\n");
         exit (-1);
   }
   helper = (union t_val *) tval;
@@ -352,19 +352,19 @@ int encode_hexstr (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr)
   union t_val *helper;
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_hexstr called w/NULL buffer!\n");
+        fprintf(stderr, "encode_hexstr called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_hexstr called w/NULL value struct !\n");
+        fprintf(stderr, "encode_hexstr called w/NULL value struct\n");
         exit (-1);
   }
   helper = (union t_val *) tval;
   string_size = strlen ( helper->strval );
 
   if ( string_size % 2 != 0 ) {
-        fprintf(stderr, "encode_hexstr: invalid hex string !\n");
+        fprintf(stderr, "encode_hexstr: invalid hex string\n");
         exit (-1);
   }
 
@@ -416,12 +416,12 @@ int encode_oid(unsigned char *buf, void *tval, struct symbol_entry *sym_ptr )
   union t_val *helper;
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_oid called w/NULL buffer!\n");
+        fprintf(stderr, "encode_oid called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_oid called w/NULL value struct !\n");
+        fprintf(stderr, "encode_oid called w/NULL value struct\n");
         exit (-1);
   }
 
@@ -447,12 +447,12 @@ int i;
 union t_val *helper; /* We only use this to cast the void* we receive to what we think it should be */
 
   if ( buf == NULL ) {
-        fprintf(stderr, "encode_ushort_list called w/NULL buffer!\n");
+        fprintf(stderr, "encode_ushort_list called w/NULL buffer\n");
         exit (-1);
   }
 
   if ( tval == NULL  ) {
-        fprintf(stderr, "encode_ushort_list called w/NULL value struct !\n");
+        fprintf(stderr, "encode_ushort_list called w/NULL value struct\n");
         exit (-1);
   }
 

+ 2 - 2
src/docsis_yy.y

@@ -501,7 +501,7 @@ merge_tlvlist(struct tlv *tlv1, struct tlv *tlv2)
 {
   struct tlv *tlvptr, *last_sibling;
   if ( tlv2 == NULL ) {
-	fprintf(stderr, "merge_tlvlist called with NULL tlv2 !\n");
+	fprintf(stderr, "merge_tlvlist called with NULL tlv2\n");
 	exit(-2);
   }
 
@@ -554,7 +554,7 @@ unsigned int flatten_tlvsubtree ( unsigned char *buf, unsigned int used_size, st
   register unsigned char *cp;
 
   if ( buf == NULL ) {
-	fprintf(stderr, "Error: can't flatten tlvlist in a NULL destination  buffer!\n" );
+	fprintf(stderr, "Error: can't flatten tlvlist in a NULL destination buffer\n" );
 	exit (-2);
   }