=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/entries.c,v retrieving revision 1.83 retrieving revision 1.84 diff -c -r1.83 -r1.84 *** src/usr.bin/cvs/entries.c 2007/09/25 11:10:28 1.83 --- src/usr.bin/cvs/entries.c 2007/10/05 19:28:23 1.84 *************** *** 1,4 **** ! /* $OpenBSD: entries.c,v 1.83 2007/09/25 11:10:28 chl Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: entries.c,v 1.84 2007/10/05 19:28:23 gilles Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 32,38 **** cvs_ent_open(const char *dir) { FILE *fp; - size_t len; CVSENTRIES *ep; char *p, buf[MAXPATHLEN]; struct cvs_ent *ent; --- 32,37 ---- *************** *** 58,66 **** if ((fp = fopen(ep->cef_path, "r")) != NULL) { while (fgets(buf, sizeof(buf), fp)) { ! len = strlen(buf); ! if (len > 0 && buf[len - 1] == '\n') ! buf[len - 1] = '\0'; if (buf[0] == 'D' && buf[1] == '\0') break; --- 57,63 ---- if ((fp = fopen(ep->cef_path, "r")) != NULL) { while (fgets(buf, sizeof(buf), fp)) { ! buf[strcspn(buf, "\n")] = '\0'; if (buf[0] == 'D' && buf[1] == '\0') break; *************** *** 75,83 **** if ((fp = fopen(ep->cef_lpath, "r")) != NULL) { while (fgets(buf, sizeof(buf), fp)) { ! len = strlen(buf); ! if (len > 0 && buf[len - 1] == '\n') ! buf[len - 1] = '\0'; p = &buf[1]; --- 72,78 ---- if ((fp = fopen(ep->cef_lpath, "r")) != NULL) { while (fgets(buf, sizeof(buf), fp)) { ! buf[strcspn(buf, "\n")] = '\0'; p = &buf[1];