From ce513ea5ae192789867b9accfb77f436a0a5452a Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Tue, 4 Oct 1994 19:35:43 +0000 Subject: [PATCH] You can't use strcat to modify constant strings! git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4441 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/asn.1/ChangeLog | 6 ++++++ src/tests/asn.1/krb5_decode_test.c | 6 +++--- src/tests/asn.1/krb5_encode_test.c | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tests/asn.1/ChangeLog b/src/tests/asn.1/ChangeLog index 1f177462b..00145d7e1 100644 --- a/src/tests/asn.1/ChangeLog +++ b/src/tests/asn.1/ChangeLog @@ -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 diff --git a/src/tests/asn.1/krb5_decode_test.c b/src/tests/asn.1/krb5_decode_test.c index 0d3f32ad1..d49a302d2 100644 --- a/src/tests/asn.1/krb5_decode_test.c +++ b/src/tests/asn.1/krb5_decode_test.c @@ -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) diff --git a/src/tests/asn.1/krb5_encode_test.c b/src/tests/asn.1/krb5_encode_test.c index ad4eaa112..8dcb90b30 100644 --- a/src/tests/asn.1/krb5_encode_test.c +++ b/src/tests/asn.1/krb5_encode_test.c @@ -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);\ -- 2.26.2