diff --git a/du2/program.c b/du2/program.c index 66c08d3..a244fb4 100644 --- a/du2/program.c +++ b/du2/program.c @@ -36,7 +36,7 @@ int read_pizza(struct pizza *item) { return 0; } - strcpy(item->name, line1, LINESIZE - 1); + strncpy(item->name, line1, LINESIZE - 1); item->name[LINESIZE - 1] = '\0'; item->price = value; return 1;