comparison th_ioctx.c @ 699:3707a823aa02

Fix to the previous commit. strdup the mode string since the argument is const.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 10 Mar 2020 16:51:55 +0200
parents 29d9083dff1c
children ec8fe89576ff
comparison
equal deleted inserted replaced
698:29d9083dff1c 699:3707a823aa02
104 if ((ctx->status = th_pstr_cpy(&ctx->mode, mode)) != THERR_OK) 104 if ((ctx->status = th_pstr_cpy(&ctx->mode, mode)) != THERR_OK)
105 return ctx->status; 105 return ctx->status;
106 } 106 }
107 else 107 else
108 { 108 {
109 ctx->mode = mode; 109 ctx->mallocated = TRUE;
110 if ((ctx->mode = th_strdup(mode)) == NULL)
111 return THERR_MALLOC;
110 } 112 }
111 113
112 return (ctx->status = thfopen(ctx)); 114 return (ctx->status = thfopen(ctx));
113 } 115 }
114 116