]> andersk Git - moira.git/commitdiff
Throw away rest of field if too long
authormar <mar>
Tue, 10 May 1988 11:34:37 +0000 (11:34 +0000)
committermar <mar>
Tue, 10 May 1988 11:34:37 +0000 (11:34 +0000)
backup/rest_db.qc

index 82ffbecf03c9f2070b0ea2d16539ba3cbc17fd48..3a3d8608dc538de517c213be58ff968223f104fa 100644 (file)
@@ -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);
     }
This page took 0.049391 seconds and 5 git commands to generate.