~ubuntu-branches/ubuntu/dapper/groff/dapper

« back to all changes in this revision

Viewing changes to src/preproc/grn/hdb.cc

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2002-03-17 04:11:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020317041150-em69nkqd2qw26v96
Tags: 1.17.2-15.woody.1
* New Danish debconf translation (thanks, Rune B. Broberg;
  closes: #131092).
* New French debconf translation (thanks, Philippe Batailler;
  closes: #138515).

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#include "error.h"
16
16
 
17
17
#define MAXSTRING 128
 
18
#define MAXSTRING_S "127"
18
19
 
19
20
/* imports from main.cc */
20
21
 
89
90
 
90
91
  SUNFILE = FALSE;
91
92
  elist = DBInit();
92
 
  (void) fscanf(file, "%s\n", string);
 
93
  (void) fscanf(file, "%" MAXSTRING_S "s%*s\n", string);
93
94
  if (strcmp(string, "gremlinfile")) {
94
95
    if (strcmp(string, "sungremlinfile")) {
95
96
      error("`%1' is not a gremlin file", gremlinfile);
103
104
 
104
105
  done = FALSE;
105
106
  while (!done) {
106
 
    /* if (fscanf(file,"%s\n", string) == EOF) */
 
107
    /* if (fscanf(file,"%" MAXSTRING_S "s\n", string) == EOF) */
107
108
    /* I changed the scanf format because the element */
108
109
    /* can have two words (e.g. CURVE SPLINE)         */
109
 
    if (fscanf(file, "\n%[^\n]\n", string) == EOF) {
 
110
    if (fscanf(file, "\n%" MAXSTRING_S "[^\n]%*s\n", string) == EOF) {
110
111
      error("`%1', error in file format", gremlinfile);
111
112
      return (elist);
112
113
    }