~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/bin/psql/mbprint.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Copyright (c) 2000-2009, PostgreSQL Global Development Group
5
5
 *
6
 
 * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.34 2009/01/01 17:23:55 momjian Exp $
 
6
 * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.35 2009/06/11 14:49:08 momjian Exp $
7
7
 *
8
8
 * XXX this file does not really belong in psql/.  Perhaps move to libpq?
9
9
 * It also seems that the mbvalidate function is redundant with existing
277
277
        }
278
278
        if (linewidth > width)
279
279
                width = linewidth;
280
 
        format_size += 1;               /* For NUL char */
 
280
        format_size += 1;                       /* For NUL char */
281
281
 
282
282
        /* Set results */
283
283
        if (result_width)
289
289
}
290
290
 
291
291
/*
292
 
 *  Format a string into one or more "struct lineptr" lines.
293
 
 *  lines[i].ptr == NULL indicates the end of the array.
 
292
 *      Format a string into one or more "struct lineptr" lines.
 
293
 *      lines[i].ptr == NULL indicates the end of the array.
294
294
 *
295
295
 * This MUST be kept in sync with pg_wcssize!
296
296
 */
297
297
void
298
298
pg_wcsformat(unsigned char *pwcs, size_t len, int encoding,
299
 
                         struct lineptr *lines, int count)
 
299
                         struct lineptr * lines, int count)
300
300
{
301
301
        int                     w,
302
302
                                chlen = 0;
378
378
                len -= chlen;
379
379
        }
380
380
        lines->width = linewidth;
381
 
        *ptr++ = '\0';                  /* Terminate formatted string */
 
381
        *ptr++ = '\0';                          /* Terminate formatted string */
382
382
 
383
383
        if (count <= 0)
384
 
                exit(1);        /* Screwup */
 
384
                exit(1);                                /* Screwup */
385
385
 
386
 
        (lines+1)->ptr = NULL;  /* terminate line array */
 
386
        (lines + 1)->ptr = NULL;        /* terminate line array */
387
387
}
388
388
 
389
389
unsigned char *