33 *
44 * Copyright (c) 2000-2004, PostgreSQL Global Development Group
55 *
6- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.52 2004/09/27 23:24:35 momjian Exp $
6+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.53 2004/11/09 15:57:53 petere Exp $
77 */
88#include "postgres_fe.h"
99#include "common.h"
@@ -227,14 +227,14 @@ print_aligned_text(const char *title, const char *const * headers,
227227widths = calloc (col_count ,sizeof (* widths ));
228228if (!widths )
229229{
230- perror ( "calloc" );
230+ fprintf ( stderr , gettext ( "out of memory\n" ) );
231231exit (EXIT_FAILURE );
232232}
233233
234234head_w = calloc (col_count ,sizeof (* head_w ));
235235if (!head_w )
236236{
237- perror ( "calloc" );
237+ fprintf ( stderr , gettext ( "out of memory\n" ) );
238238exit (EXIT_FAILURE );
239239}
240240}
@@ -253,7 +253,7 @@ print_aligned_text(const char *title, const char *const * headers,
253253cell_w = calloc (cell_count ,sizeof (* cell_w ));
254254if (!cell_w )
255255{
256- perror ( "calloc" );
256+ fprintf ( stderr , gettext ( "out of memory\n" ) );
257257exit (EXIT_FAILURE );
258258}
259259}
@@ -437,7 +437,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
437437head_w = calloc (col_count ,sizeof (* head_w ));
438438if (!head_w )
439439{
440- perror ( "calloc" );
440+ fprintf ( stderr , gettext ( "out of memory\n" ) );
441441exit (EXIT_FAILURE );
442442}
443443}
@@ -461,7 +461,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
461461cell_w = calloc (cell_count ,sizeof (* cell_w ));
462462if (!cell_w )
463463{
464- perror ( "calloc" );
464+ fprintf ( stderr , gettext ( "out of memory\n" ) );
465465exit (EXIT_FAILURE );
466466}
467467}
@@ -485,7 +485,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
485485divider = malloc (hwidth + dwidth + 10 );
486486if (!divider )
487487{
488- perror ( "malloc" );
488+ fprintf ( stderr , gettext ( "out of memory\n" ) );
489489exit (EXIT_FAILURE );
490490}
491491divider [0 ]= '\0' ;
@@ -514,7 +514,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
514514
515515if (!record_str )
516516{
517- perror ( "malloc" );
517+ fprintf ( stderr , gettext ( "out of memory\n" ) );
518518exit (EXIT_FAILURE );
519519}
520520
@@ -532,7 +532,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
532532
533533if (!div_copy )
534534{
535- perror ( "malloc" );
535+ fprintf ( stderr , gettext ( "out of memory\n" ) );
536536exit (EXIT_FAILURE );
537537}
538538
@@ -1153,7 +1153,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
11531153headers = calloc (nfields + 1 ,sizeof (* headers ));
11541154if (!headers )
11551155{
1156- perror ( "calloc" );
1156+ fprintf ( stderr , gettext ( "out of memory\n" ) );
11571157exit (EXIT_FAILURE );
11581158}
11591159
@@ -1165,7 +1165,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
11651165cells = calloc (ncells + 1 ,sizeof (* cells ));
11661166if (!cells )
11671167{
1168- perror ( "calloc" );
1168+ fprintf ( stderr , gettext ( "out of memory\n" ) );
11691169exit (EXIT_FAILURE );
11701170}
11711171
@@ -1186,14 +1186,14 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
11861186footers = calloc (2 ,sizeof (* footers ));
11871187if (!footers )
11881188{
1189- perror ( "calloc" );
1189+ fprintf ( stderr , gettext ( "out of memory\n" ) );
11901190exit (EXIT_FAILURE );
11911191}
11921192
11931193footers [0 ]= malloc (100 );
11941194if (!footers [0 ])
11951195{
1196- perror ( "malloc" );
1196+ fprintf ( stderr , gettext ( "out of memory\n" ) );
11971197exit (EXIT_FAILURE );
11981198}
11991199if (PQntuples (result )== 1 )
@@ -1208,7 +1208,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
12081208align = calloc (nfields + 1 ,sizeof (* align ));
12091209if (!align )
12101210{
1211- perror ( "calloc" );
1211+ fprintf ( stderr , gettext ( "out of memory\n" ) );
12121212exit (EXIT_FAILURE );
12131213}
12141214