~ubuntu-branches/ubuntu/jaunty/freeglut/jaunty

« back to all changes in this revision

Viewing changes to progs/demos/Fractals/fractals.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-11-19 13:19:55 UTC
  • Revision ID: james.westby@ubuntu.com-20081119131955-1wfd4zl5b5ie81sh
Tags: 2.4.0-6.1ubuntu1
Fix build failures (don't ignore return values with -Werror).

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
{
213
213
  FILE *fptr = fopen ( fnme, "rt" ) ;
214
214
  int i ;
215
 
  char inputline [ 256 ] ;
 
215
  char inputline [ 256 ] , *line ;
216
216
 
217
217
  if ( fptr )
218
218
  {
219
219
    /* Read a header line */
220
 
    fgets ( inputline, 256, fptr ) ;
 
220
    line = fgets ( inputline, 256, fptr ) ;
221
221
 
222
222
    /* Read a comment line */
223
 
    fgets ( inputline, 256, fptr ) ;
 
223
    line = fgets ( inputline, 256, fptr ) ;
224
224
 
225
225
    /* Read the window title */
226
 
    fgets ( inputline, 256, fptr ) ;
 
226
    line = fgets ( inputline, 256, fptr ) ;
227
227
    /* We assume here that this line will not exceed 79 characters plus a 
228
228
       newline (window_title is 80 characters long). That'll cause a buffer 
229
229
       overflow. For a simple program like  this, though, we're letting it 
232
232
    sscanf ( inputline, "%[a-zA-Z0-9!@#$%^&*()+=/\\_-\" ]", window_title ) ; 
233
233
 
234
234
    /* Read a comment line */
235
 
    fgets ( inputline, 256, fptr ) ;
 
235
    line = fgets ( inputline, 256, fptr ) ;
236
236
 
237
237
    /* Read the number of affine transformations */
238
 
    fgets ( inputline, 256, fptr ) ;
 
238
    line = fgets ( inputline, 256, fptr ) ;
239
239
    sscanf ( inputline, "%d", &num_trans ) ;
240
240
 
241
241
    affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
242
242
 
243
243
    /* Read a comment line */
244
 
    fgets ( inputline, 256, fptr ) ;
 
244
    line = fgets ( inputline, 256, fptr ) ;
245
245
 
246
246
    for ( i = 0; i < num_trans; i++ )
247
247
    {
248
248
      /* Read an affine transformation definition */
249
 
      fgets ( inputline, 256, fptr ) ;
 
249
      line = fgets ( inputline, 256, fptr ) ;
250
250
      sscanf ( inputline, "%lf %lf %lf %lf %lf %lf", &affine[i].a00, &affine[i].a01,
251
251
                       &affine[i].a10, &affine[i].a11, &affine[i].b0, &affine[i].b1 ) ;
252
252
    }