~ubuntu-branches/ubuntu/vivid/bc/vivid-proposed

« back to all changes in this revision

Viewing changes to dc/string.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 12:24:03 UTC
  • mfrom: (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20071205122403-rv1a7x90ktu1wl95
Tags: 1.06.94-3ubuntu1
* Merge with Debian; remaining changes:
  - Make bc/dc notice read and write errors on its input and output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
2
2
 * implement string functions for dc
3
3
 *
4
 
 * Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
 
4
 * Copyright (C) 1994, 1997, 1998, 2006 Free Software Foundation, Inc.
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
7
7
 * it under the terms of the GNU General Public License as published by
18
18
 * program's author (see below) or write to:
19
19
 *
20
20
 *    The Free Software Foundation, Inc.
21
 
 *    59 Temple Place, Suite 330
22
 
 *    Boston, MA 02111 USA
 
21
 *    51 Franklin Street, Fifth Floor
 
22
 *    Boston, MA 02110-1301  USA
23
23
 */
24
24
 
25
25
/* This should be the only module that knows the internals of type dc_string */
148
148
        char *p;
149
149
        const char *end;
150
150
 
151
 
        if (!line_buf){
 
151
        if (line_buf == NULL){
152
152
                /* initial buflen should be large enough to handle most cases */
153
 
                buflen = 2016;
 
153
                buflen = (size_t) 2016;
154
154
                line_buf = dc_malloc(buflen);
155
155
        }
156
156
        p = line_buf;
170
170
                         */
171
171
                        buflen += 2048;
172
172
                        line_buf = realloc(line_buf, buflen);
173
 
                        if (!line_buf)
 
173
                        if (line_buf == NULL)
174
174
                                dc_memfail();
175
175
                        p = line_buf + offset;
176
176
                        end = line_buf + buflen;
211
211
{
212
212
        /* nothing to do for this implementation */
213
213
}
 
214
 
 
215
 
 
216
/*
 
217
 * Local Variables:
 
218
 * mode: C
 
219
 * tab-width: 4
 
220
 * End:
 
221
 * vi: set ts=4 :
 
222
 */