changeset 697:87e97ea5afd1

Add some error checking.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 09 Mar 2020 22:26:19 +0200
parents 9bbacd72df3d
children 29d9083dff1c
files th_ioctx.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_ioctx.c	Mon Mar 09 19:13:52 2020 +0200
+++ b/th_ioctx.c	Mon Mar 09 22:26:19 2020 +0200
@@ -99,7 +99,8 @@
 
     thfclose(ctx);
 
-    th_pstr_cpy(&ctx->mode, mode);
+    if ((ctx->status = th_pstr_cpy(&ctx->mode, mode)) != THERR_OK)
+        return ctx->status;
 
     return (ctx->status = thfopen(ctx));
 }