--- rpl/src/rplexternals.h 2013/03/29 10:30:32 1.47 +++ rpl/src/rplexternals.h 2013/03/29 11:05:59 1.48 @@ -960,19 +960,22 @@ #define setString(object, string) do { \ ifIsString(object) \ { \ - if ((*object).nombre_occurrences > 1) \ + if (string == NULL) executionError("Nullified string"); else \ { \ - struct_objet *__tmp_object; \ - if ((__tmp_object = copie_objet(object, 'O')) == NULL) \ + if ((*object).nombre_occurrences > 1) \ + { \ + struct_objet *__tmp_object; \ + if ((__tmp_object = copie_objet(object, 'O')) == NULL) \ + systemError("Memory allocation error"); \ + liberation(object); \ + object = __tmp_object; \ + } \ + free((unsigned char *) (*object).objet); \ + if (((*object).objet = malloc((strlen(string) + 1) * \ + sizeof(unsigned char))) == NULL) \ systemError("Memory allocation error"); \ - liberation(object); \ - object = __tmp_object; \ + strcpy((char *) (*object).objet, string); \ } \ - free((unsigned char *) (*object).objet); \ - if (((*object).objet = malloc((strlen(string) + 1) * \ - sizeof(unsigned char))) == NULL) \ - systemError("Memory allocation error"); \ - strcpy((char *) (*object).objet, string); \ } \ else executionError("Type mistmatch error"); } while(0)