~ubuntu-branches/ubuntu/saucy/bc/saucy-proposed

« back to all changes in this revision

Viewing changes to lib/number.c

  • Committer: Package Import Robot
  • Author(s): John G. Hasler
  • Date: 2012-06-22 21:00:45 UTC
  • Revision ID: package-import@ubuntu.com-20120622210045-cpu8v54e1x1z0ep0
Tags: 1.06.95-3
* Applied patch from Pádraig Brady.
  Closes: #608255: bc uses uninitialized memory

* Applied patch from Paul Dwerryhouse.
  Closes: #472250: please return support for .dcrc file

* Applied patch from Ian Jackson.
  Closes: #488735: notice read and write errors on input and output

* Generated bc.html and dc.html but something is still wrong.

* Added homepage field to debian/control.

* I can't see the problem with hyphens.

* Fixed doc-base white space.

* Added watch file.

* I believe that the above changes deal with 558188.
  Closes: #558188: Changes made in 1.06.94-3.1 NMU have been lost

Show diffs side-by-side

added added

removed removed

Lines of Context:
1776
1776
out_char (int c)
1777
1777
{
1778
1778
  putchar(c);
 
1779
  checkferror_output(stdout);
1779
1780
}
1780
1781
 
1781
1782
 
1785
1786
{
1786
1787
  bc_out_num (num, 10, out_char, 0);
1787
1788
  out_char ('\n');
 
1789
  checkferror_output(stdout);
1788
1790
}
1789
1791
 
1790
1792
 
1799
1801
  printf ("%s=", name);
1800
1802
  for (i=0; i<len; i++) printf ("%c",BCD_CHAR(num[i]));
1801
1803
  printf ("\n");
 
1804
  checkferror_output(stdout);
1802
1805
}
1803
1806
 
1804
1807
#endif
 
1808
 
 
1809
/* check ferror() status and if so die */
 
1810
void
 
1811
checkferror_input (fp)
 
1812
        FILE *fp;
 
1813
{
 
1814
        if (ferror(fp)) {
 
1815
                perror("dc: could not read input file");
 
1816
                exit(EXIT_FAILURE);
 
1817
        }
 
1818
}
 
1819
 
 
1820
void
 
1821
checkferror_output (fp)
 
1822
        FILE *fp;
 
1823
{
 
1824
        if (ferror(fp)) {
 
1825
                perror("dc: could not write output file");
 
1826
                exit(EXIT_FAILURE);
 
1827
        }
 
1828
}