~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libciomr/io_getline.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <stdio.h>
2
 
#include "iomrparam.h"
3
 
 
4
 
int
5
 
io_getline(input,line)
6
 
FILE *input;
7
 
char line[MAX_STRING];
8
 
{
9
 
  int i;
10
 
 
11
 
  for (i=0; i<MAX_STRING; i++) {
12
 
    if ((line[i]=fgetc(input)) == EOF) return(-1);
13
 
    if(feof(input)) return(-1);
14
 
    if (line[i] == '\n') {
15
 
      line[i] = '\0';
16
 
      return(0);
17
 
      }
18
 
    }
19
 
 
20
 
  fprintf(stdout,"io_getline: buffer size exceeded\n");
21
 
  fprintf(stderr,"io_getline: buffer size exceeded\n");
22
 
  return(-1);
23
 
  }