You can't use strcat to modify constant strings!
authorTheodore Tso <tytso@mit.edu>
Tue, 4 Oct 1994 19:35:43 +0000 (19:35 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 4 Oct 1994 19:35:43 +0000 (19:35 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4441 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/asn.1/ChangeLog
src/tests/asn.1/krb5_decode_test.c
src/tests/asn.1/krb5_encode_test.c

index 1f177462b095062069f7289fffaf21d6a85ef915..00145d7e1006593c01ce17a980915acf3f71aafa 100644 (file)
@@ -1,3 +1,9 @@
+Tue Oct  4 14:32:39 1994  Theodore Y. Ts'o  (tytso@dcl)
+
+       * krb5_decode_test.c (setup, decode_run):
+       * krb5_encode_test.c (setup, encode_run): Don't call strcat on a
+               constant string --- you can't modify a read only string!
+
 Thu Sep 29 23:01:58 1994  Theodore Y. Ts'o  (tytso@dcl)
 
        * Makefile.in: Relink executabes when libraries change
index 0d3f32ad18683e43a54a075e5f2dff0a8e0e03cf..d49a302d2585a3f67d495b55d9b86576b8ca1b26 100644 (file)
@@ -22,19 +22,19 @@ void main()
   type ref, *var;\
   retval = constructor(&ref);\
   if(retval){\
-    com_err(strcat("making sample ",typestring),retval,"");\
+    com_err("krb5_decode_test", retval, "while making sample %s", typestring);\
     exit(1);\
   }
     
 #define decode_run(typestring,description,encoding,decoder,comparator)\
     retval = krb5_data_hex_parse(&code,encoding);\
     if(retval){\
-      com_err(strcat("parsing ",strcat(typestring,description)),retval,"");\
+      com_err("krb5_decode_test", retval, "while parsing %s", typestring);\
       exit(1);\
     }\
     retval = decoder(&code,&var);\
     if(retval){\
-      com_err(strcat("decoding ",strcat(typestring,description)),retval,"");\
+      com_err("krb5_decode_test", retval, "while decoding %s", typestring);\
     }\
     assert(comparator(&ref,var),typestring);\
     printf("%s\n",description)
index ad4eaa1127ea0646b734b07ca886e8a7b233abbe..8dcb90b307487e3232779066925be635baedb498 100644 (file)
@@ -26,19 +26,19 @@ void main()
 #define setup(value,type,typestring,constructor)\
   retval = constructor(&(value));\
   if(retval){\
-    com_err(strcat("making sample ",typestring),retval,"");\
+    com_err("krb5_encode_test", retval, "while making sample %s", typestring);\
     exit(1);\
   }
     
 #define encode_run(value,type,typestring,description,encoder)\
   retval = encoder(&(value),&(code));\
   if(retval){\
-    com_err(strcat("encoding ",typestring),retval,"");\
+    com_err("krb5_encode_test", retval,"while encoding %s", typestring);\
     exit(1);\
   }\
   retval = asn1_krb5_data_unparse(code,&(code_string));\
   if(retval){\
-    com_err(strcat("unparsing ",typestring),retval,"");\
+    com_err("krb5_encode_test", retval ,"while unparsing %s", typestring);\
     exit(1);\
   }\
   ktest_destroy_data(&code);\