3
3
*
4
4
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
5
5
*
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 $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "common.h"
@@ -227,14 +227,14 @@ print_aligned_text(const char *title, const char *const * headers,
227
227
widths = calloc (col_count , sizeof (* widths ));
228
228
if (!widths )
229
229
{
230
- perror ( "calloc" );
230
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
231
231
exit (EXIT_FAILURE );
232
232
}
233
233
234
234
head_w = calloc (col_count , sizeof (* head_w ));
235
235
if (!head_w )
236
236
{
237
- perror ( "calloc" );
237
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
238
238
exit (EXIT_FAILURE );
239
239
}
240
240
}
@@ -253,7 +253,7 @@ print_aligned_text(const char *title, const char *const * headers,
253
253
cell_w = calloc (cell_count , sizeof (* cell_w ));
254
254
if (!cell_w )
255
255
{
256
- perror ( "calloc" );
256
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
257
257
exit (EXIT_FAILURE );
258
258
}
259
259
}
@@ -437,7 +437,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
437
437
head_w = calloc (col_count , sizeof (* head_w ));
438
438
if (!head_w )
439
439
{
440
- perror ( "calloc" );
440
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
441
441
exit (EXIT_FAILURE );
442
442
}
443
443
}
@@ -461,7 +461,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
461
461
cell_w = calloc (cell_count , sizeof (* cell_w ));
462
462
if (!cell_w )
463
463
{
464
- perror ( "calloc" );
464
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
465
465
exit (EXIT_FAILURE );
466
466
}
467
467
}
@@ -485,7 +485,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
485
485
divider = malloc (hwidth + dwidth + 10 );
486
486
if (!divider )
487
487
{
488
- perror ( "malloc" );
488
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
489
489
exit (EXIT_FAILURE );
490
490
}
491
491
divider [0 ] = '\0' ;
@@ -514,7 +514,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
514
514
515
515
if (!record_str )
516
516
{
517
- perror ( "malloc" );
517
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
518
518
exit (EXIT_FAILURE );
519
519
}
520
520
@@ -532,7 +532,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
532
532
533
533
if (!div_copy )
534
534
{
535
- perror ( "malloc" );
535
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
536
536
exit (EXIT_FAILURE );
537
537
}
538
538
@@ -1153,7 +1153,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
1153
1153
headers = calloc (nfields + 1 , sizeof (* headers ));
1154
1154
if (!headers )
1155
1155
{
1156
- perror ( "calloc" );
1156
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
1157
1157
exit (EXIT_FAILURE );
1158
1158
}
1159
1159
@@ -1165,7 +1165,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
1165
1165
cells = calloc (ncells + 1 , sizeof (* cells ));
1166
1166
if (!cells )
1167
1167
{
1168
- perror ( "calloc" );
1168
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
1169
1169
exit (EXIT_FAILURE );
1170
1170
}
1171
1171
@@ -1186,14 +1186,14 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
1186
1186
footers = calloc (2 , sizeof (* footers ));
1187
1187
if (!footers )
1188
1188
{
1189
- perror ( "calloc" );
1189
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
1190
1190
exit (EXIT_FAILURE );
1191
1191
}
1192
1192
1193
1193
footers [0 ] = malloc (100 );
1194
1194
if (!footers [0 ])
1195
1195
{
1196
- perror ( "malloc" );
1196
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
1197
1197
exit (EXIT_FAILURE );
1198
1198
}
1199
1199
if (PQntuples (result ) == 1 )
@@ -1208,7 +1208,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
1208
1208
align = calloc (nfields + 1 , sizeof (* align ));
1209
1209
if (!align )
1210
1210
{
1211
- perror ( "calloc" );
1211
+ fprintf ( stderr , gettext ( "out of memory\n" ) );
1212
1212
exit (EXIT_FAILURE );
1213
1213
}
1214
1214
0 commit comments