cmake: build&run tests (sortof)
[awesomized/libmemcached] / libtest / has.cc
index 2d9abf6b4f26abd70a7a9920384caadc21128dda..6048bacf24cd806e955779459b5b347da06924d1 100644 (file)
@@ -75,13 +75,15 @@ bool has_libdrizzle(void)
 bool has_postgres_support(void)
 {
   char *getenv_ptr;
-  if (bool((getenv_ptr= getenv("POSTGES_IS_RUNNING_AND_SETUP"))))
+  if (bool((getenv_ptr= getenv("POSTGRES_IS_RUNNING_AND_SETUP"))))
   {
     (void)(getenv_ptr);
+#if defined(HAVE_LIBPQ) && HAVE_LIBPQ
     if (HAVE_LIBPQ)
     {
       return true;
     }
+#endif
   }
 
   return false;
@@ -165,7 +167,7 @@ static void initialize_memcached_binary_path()
 
     if (access(arg_buffer.str().c_str(), X_OK) == 0)
     {
-      strncpy(memcached_binary_path, arg_buffer.str().c_str(), FILENAME_MAX);
+      strncpy(memcached_binary_path, arg_buffer.str().c_str(), FILENAME_MAX-1);
     }
   }
 #endif