diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/dt_common.c | 10 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-misc.c | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c index dc5fbe7fd96..52bb5d2ca17 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt_common.c +++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.52 2010/05/08 16:39:52 tgl Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.53 2010/05/09 02:15:59 tgl Exp $ */ #include "postgres_fe.h" @@ -856,11 +856,9 @@ EncodeDateTime(struct tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, cha sprintf(str + strlen(str), " BC"); /* - * Note: the uses of %.*s in this function would be unportable - * if the timezone names ever contain non-ASCII characters, - * since some platforms think the string length is measured - * in characters not bytes. However, all TZ abbreviations in - * the Olson database are plain ASCII. + * Note: the uses of %.*s in this function would be risky if the + * timezone names ever contain non-ASCII characters. However, all + * TZ abbreviations in the Olson database are plain ASCII. */ if (tzp != NULL && tm->tm_isdst >= 0) diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 096e0d84a7a..f76168ccd44 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -23,7 +23,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.142 2010/05/08 16:39:53 tgl Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.143 2010/05/09 02:16:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -70,8 +70,8 @@ static int pqSocketPoll(int sock, int forRead, int forWrite, time_t end_time); /* * fputnbytes: print exactly N bytes to a file * - * Think not to use fprintf with a %.*s format for this. Some machines - * believe %s's precision is measured in characters, others in bytes. + * We avoid using %.*s here because it can misbehave if the data + * is not valid in what libc thinks is the prevailing encoding. */ static void fputnbytes(FILE *f, const char *str, size_t n) |