--- libaitcfg/src/pwd.c 2013/05/30 09:12:27 1.3 +++ libaitcfg/src/pwd.c 2022/12/05 22:31:12 1.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: pwd.c,v 1.3 2013/05/30 09:12:27 misho Exp $ +* $Id: pwd.c,v 1.5 2022/12/05 22:31:12 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, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 +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;