Skip to content

Commit 492059d

Browse files
author
Michael Meskes
committed
Move from strcmp to strncmp to be more tolerant for changes to the parser.
1 parent ef9ed9b commit 492059d

File tree

1 file changed

+2
-2
lines changed
  • src/interfaces/ecpg/ecpglib

1 file changed

+2
-2
lines changed

src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.42 2008/05/16 15:20:03 petere Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.43 2008/11/01 19:53:35 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -204,7 +204,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
204204
PQclear(res);
205205
}
206206

207-
if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0)
207+
if (strncmp(transaction, "commit", 6) == 0 || strncmp(transaction, "rollback", 8) == 0)
208208
con->committed = true;
209209
else
210210
con->committed = false;

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