--- libaitcfg/src/pwd.c 2014/01/29 23:48:34 1.4 +++ libaitcfg/src/pwd.c 2022/12/05 22:02:11 1.4.24.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: pwd.c,v 1.4 2014/01/29 23:48:34 misho Exp $ +* $Id: pwd.c,v 1.4.24.1 2022/12/05 22:02:11 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2014 +Copyright 2004 - 2022 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -94,7 +94,8 @@ cfgReadPasswd(FILE *f, pwd_root_t * __restrict pwd) while (!feof(f)) { memset(line, 0, sizeof line); - fgets(line, sizeof line - 1, f); + if (!fgets(line, sizeof(line) - 1, f)) + break; if (!(pos = strpbrk(line, "\r\n"))) { /* skip line, too long */ continue;