From 5ac04f029f2876284e8af10275bdd63e75fc90e7 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 17 Jun 2016 16:39:51 -0400 Subject: Prepare Postgres code for NULL error fields --- src/c/urweb.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/c/urweb.c') diff --git a/src/c/urweb.c b/src/c/urweb.c index 286ec7be..afe8457b 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -4968,3 +4968,10 @@ void uw_Sqlcache_flush(uw_context ctx, uw_Sqlcache_Cache *cache, char **keys) { } pthread_rwlock_unlock(&cache->lockIn); } + +int strcmp_nullsafe(const char *str1, const char *str2) { + if (str1) + return strcmp(str1, str2); + else + return 1; +} -- cgit v1.2.3