~ubuntu-branches/debian/sid/bc/sid

« back to all changes in this revision

Viewing changes to lib/number.c

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2009-04-16 10:23:39 UTC
  • Revision ID: james.westby@ubuntu.com-20090416102339-l7970sr667eekbvw
Tags: 1.06.94-3.1
* Non-maintainer upload with John's permission.
* Apply patch to restore the .dcrc config file (closes: #472250)
* Merge patch from Ubuntu to notice read and write errors on
  input and output (closes: #488735)
* Include the bc manual (HTML) in the bc binary package

* Bump Standards Version to 3.8.1
* Bump debhelper compatibility to 7
* debian/rules: replace "dh_clean -k" with "dh_prep"
* debian/control: Add homepage field
* Fix hyphens in the bc and dc manpages
* Add a watch file
* debian/dc.doc-base: Remove leading whitespace
* debian/dc.doc-base: Move to section Science/Mathematics

Show diffs side-by-side

added added

removed removed

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