Skip to content

Commit 598bb8c

Browse files
committed
psql: Remove inappropriate const qualifiers
Since mbvalidate() can alter the string it validates, having the callers claim that the strings they accept are const is inappropriate.
1 parent 359dea2 commit 598bb8c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/bin/psql/mbprint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ unsigned char *
385385
mbvalidate(unsigned char *pwcs, int encoding)
386386
{
387387
if (encoding == PG_UTF8)
388-
mb_utf_validate((unsigned char *) pwcs);
388+
mb_utf_validate(pwcs);
389389
else
390390
{
391391
/*

src/bin/psql/print.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ printTableInit(printTableContent *const content, const printTableOpt *opt,
21222122
* column.
21232123
*/
21242124
void
2125-
printTableAddHeader(printTableContent *const content, const char *header,
2125+
printTableAddHeader(printTableContent *const content, char *header,
21262126
const bool translate, const char align)
21272127
{
21282128
#ifndef ENABLE_NLS
@@ -2162,7 +2162,7 @@ printTableAddHeader(printTableContent *const content, const char *header,
21622162
* Note: Automatic freeing of translatable strings is not supported.
21632163
*/
21642164
void
2165-
printTableAddCell(printTableContent *const content, const char *cell,
2165+
printTableAddCell(printTableContent *const content, char *cell,
21662166
const bool translate, const bool mustfree)
21672167
{
21682168
#ifndef ENABLE_NLS

src/bin/psql/print.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ extern void printTableInit(printTableContent *const content,
162162
const printTableOpt *opt, const char *title,
163163
const int ncolumns, const int nrows);
164164
extern void printTableAddHeader(printTableContent *const content,
165-
const char *header, const bool translate, const char align);
165+
char *header, const bool translate, const char align);
166166
extern void printTableAddCell(printTableContent *const content,
167-
const char *cell, const bool translate, const bool mustfree);
167+
char *cell, const bool translate, const bool mustfree);
168168
extern void printTableAddFooter(printTableContent *const content,
169169
const char *footer);
170170
extern void printTableSetFooter(printTableContent *const content,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy