]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Remove function substring from rrd_graph.c
authorWolfgang Stöggl <c72578@yahoo.de>
Thu, 10 Jan 2019 13:39:37 +0000 (14:39 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Thu, 10 Jan 2019 16:20:14 +0000 (17:20 +0100)
- The function substring is not used any more. This was a leftover
  from https://github.com/oetiker/rrdtool-1.x/commit/cd4a728
- Fixes rrd_graph.c:6159:7: warning:
  no previous prototype for 'substring' [-Wmissing-prototypes]

src/rrd_graph.c

index cdff5ea3e0c8857c9fe23bf14af8cefb2d973b6a..8a6be0d75554b3d1b462370dabb978ba3c208c2c 100644 (file)
@@ -6156,24 +6156,6 @@ void time_clean(
     result[jj] = '\0'; /* We must force the end of the string */
 }
 
-char *substring(const char *string, int position, int length)
-{
-   char *pointer;
-
-   pointer = malloc(length+1);
-
-   if (pointer == NULL)
-   {
-      printf("Unable to allocate memory.\n");
-      exit(1);
-   }
-
-   strncpy(pointer, (string+position), length);
-   *(pointer+length+1) = '\0';
-
-   return pointer;
-}
-
 image_title_t graph_title_split(
     const char *title)
 {