From 1102dfd4322d9a62fb38c83aa70857ac29f171ef Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:51:35 +0000 Subject: Tue, Feb 27, 2024, 12:51 PM -08:00 --- wk4/lect/copy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wk4/lect/copy.c b/wk4/lect/copy.c index 470340a..4d442c5 100644 --- a/wk4/lect/copy.c +++ b/wk4/lect/copy.c @@ -9,6 +9,10 @@ int main(void) char *s = get_string("s: "); char *t = malloc(strlen(s) + 1); + if (t == NULL) + { + return 1; + } for (int i = 0, n = strlen(s); i <= n; i++) { -- cgit v1.2.3