From 9cf69cfc85adbd23d7dce2982669d32a13a55b7f Mon Sep 17 00:00:00 2001 From: mar Date: Tue, 10 May 1988 11:34:37 +0000 Subject: [PATCH] Throw away rest of field if too long --- backup/rest_db.qc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backup/rest_db.qc b/backup/rest_db.qc index 82ffbecf..3a3d8608 100644 --- a/backup/rest_db.qc +++ b/backup/rest_db.qc @@ -6,9 +6,12 @@ * Copyright (C) 1987 by the Massachusetts Institute of Technology * * $Log$ - * Revision 1.1 1987-07-13 03:50:02 wesommer - * Initial revision + * Revision 1.2 1988-05-10 11:34:37 mar + * Throw away rest of field if too long * + * Revision 1.1 87/07/13 03:50:02 wesommer + * Initial revision + * */ #ifndef lint @@ -151,9 +154,11 @@ void parse_str(f, buf, len) if (c == EOF) return; - if (c != EOF && c != ':' && c != '\n') + if (c != EOF && c != ':' && c != '\n') { fprintf(stderr, "Field too wide, truncated\n"); - else { + while ((c = getc(f)) != EOF && c != ':' && c != '\n'); + (void) ungetc(c, f); + } else { *buf++ = 0; (void) ungetc(c, f); } -- 2.45.2