applied kurt's patch to fix unlikely, but potential, string underflow
problem in psql
This commit is contained in:
parent
ab57e09e1c
commit
dfca092633
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.2 1996/07/28 07:08:15 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.3 1996/08/06 20:23:14 julian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -42,7 +42,7 @@ char *rightTrim(char *s)
|
||||
{
|
||||
char *sEnd;
|
||||
sEnd = s+strlen(s)-1;
|
||||
while (isspace(*sEnd))
|
||||
while (sEnd >= s && isspace(*sEnd))
|
||||
sEnd--;
|
||||
if (sEnd < s)
|
||||
s[0]='\0';
|
||||
|
Loading…
Reference in New Issue
Block a user