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

« back to all changes in this revision

Viewing changes to dc/numeric.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:
134
134
        bc_init_num(CastNumPtr(result));
135
135
        if (bc_divide(CastNum(a), CastNum(b), CastNumPtr(result), kscale)){
136
136
                fprintf(stderr, "%s: divide by zero\n", progname);
 
137
                checkferror_output(stderr);
137
138
                return DC_DOMAIN_ERROR;
138
139
        }
139
140
        return DC_SUCCESS;
156
157
        if (bc_divmod(CastNum(a), CastNum(b),
157
158
                                                CastNumPtr(quotient), CastNumPtr(remainder), kscale)){
158
159
                fprintf(stderr, "%s: divide by zero\n", progname);
 
160
                checkferror_output(stderr);
159
161
                return DC_DOMAIN_ERROR;
160
162
        }
161
163
        return DC_SUCCESS;
174
176
        bc_init_num(CastNumPtr(result));
175
177
        if (bc_modulo(CastNum(a), CastNum(b), CastNumPtr(result), kscale)){
176
178
                fprintf(stderr, "%s: remainder by zero\n", progname);
 
179
                checkferror_output(stderr);
177
180
                return DC_DOMAIN_ERROR;
178
181
        }
179
182
        return DC_SUCCESS;
226
229
        tmp = bc_copy_num(CastNum(value));
227
230
        if (!bc_sqrt(&tmp, kscale)){
228
231
                fprintf(stderr, "%s: square root of negative number\n", progname);
 
232
                checkferror_output(stderr);
229
233
                bc_free_num(&tmp);
230
234
                return DC_DOMAIN_ERROR;
231
235
        }
429
433
{
430
434
        out_char('\0'); /* clear the column counter */
431
435
        bc_out_num(CastNum(value), obase, out_char, 0);
432
 
        if (newline_p == DC_WITHNL)
 
436
        if (newline_p == DC_WITHNL) {
433
437
                putchar ('\n');
 
438
                checkferror_output(stdout);
 
439
        }
434
440
        if (discard_p == DC_TOSS)
435
441
                dc_free_num(&value);
436
442
}
475
481
 
476
482
        for (cur=top_of_stack; cur; cur=next) {
477
483
                putchar(cur->digit);
 
484
                checkferror_output(stdout);
478
485
                next = cur->link;
479
486
                free(cur);
480
487
        }
592
599
                        out_col = 1;
593
600
                }
594
601
                putchar(ch);
 
602
                checkferror_output(stderr);
595
603
        }
596
604
}
597
605
 
631
639
        vfprintf (stderr, mesg, args);
632
640
        va_end (args);
633
641
        fprintf (stderr, "\n");
 
642
        checkferror_output(stderr);
634
643
}
635
644
 
636
645
 
664
673
        vfprintf (stderr, mesg, args);
665
674
        va_end (args);
666
675
        fprintf (stderr, "\n");
 
676
        checkferror_output(stderr);
667
677
}
668
678
 
669
679