diff options
-rw-r--r-- | wk4/lect/copy.c | 4 |
1 files changed, 4 insertions, 0 deletions
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++) { |