applied kurt's patch to fix unlikely, but potential, string underflow

problem in psql
This commit is contained in:
Julian Assange 1996-08-06 20:23:14 +00:00
parent ab57e09e1c
commit dfca092633
1 changed files with 2 additions and 2 deletions

View File

@ -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';