fix locations for installing the sample programs to make automake happy
[rrdtool.git] / src / rrd_client.c
index 5481ba3..f271f3d 100644 (file)
@@ -913,8 +913,7 @@ rrd_info_t * rrdc_info (const char *filename) /* {{{ */
         break;
     case RD_I_STR:
         chomp(s);
-        info.u_str = (char*)malloc(sizeof(char) * (strlen(s) + 1));
-        strcpy(info.u_str,s);
+        info.u_str = strdup(s);
         break;
     case RD_I_BLO:
         rrd_set_error ("rrdc_info: BLOB objects are not supported");
@@ -1495,7 +1494,11 @@ int rrdc_stats_get (rrdc_stats_t **ret_stats) /* {{{ */
   response_free (res);
 
   if (head == NULL)
+#ifdef EPROTO
     return (EPROTO);
+#else
+    return (EINVAL);
+#endif
 
   *ret_stats = head;
   return (0);