You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added a very hacky line in ic_sub() to clear the buffer in these circumstances. There are clearly tidier ways of doing this, but I just wanted it to work! New ic_sub() below....
void ic_sub(char *resource)
{
int i;
ic_check( strlen(saved_section) + strlen(influx_tags) +strlen(saved_sub) + strlen(resource) + 9);
/* remove previously added section */
if (first_sub) {
for (i = output_char - 1; i > 0; i--) {
if (output[i] == '\n') {
output[i + 1] = 0;
output_char = i + 1;
break;
}
}
if( i==0 ){ output_char = 0; output[output_char] = '\0'; } // Clears previous section at start of output[]
}
first_sub = 0;
/* remove the trailing s */
strcpy(saved_sub, saved_section);
if (saved_sub[strlen(saved_sub) - 1] == 's') {
saved_sub[strlen(saved_sub) - 1] = 0;
}
output_char += sprintf(&output[output_char], "%s,%s,%s_name=%s ", saved_section, influx_tags, saved_sub, resource);
subended = 0;
DEBUG fprintf(stderr, "ic_sub(\"%s\") count=%ld\n", resource, output_char);
}
The text was updated successfully, but these errors were encountered:
kendownie
changed the title
ic_sub as first data in outpuyt[] eg. after an ic_push doesn't clear the previously added section correctly
ic_sub as first data in output[] eg. after an ic_push doesn't clear the previously added section correctly
Jul 13, 2021
I've added a very hacky line in ic_sub() to clear the buffer in these circumstances. There are clearly tidier ways of doing this, but I just wanted it to work! New ic_sub() below....
void ic_sub(char *resource)
{
int i;
}
The text was updated successfully, but these errors were encountered: