+int skipxml(char **buf){
+ char *ptr;
+ ptr=(*buf);
+ do {
+ (*buf)=ptr;
+ while((*(ptr+1)) && ((*ptr)==' ' || (*ptr)=='\r' || (*ptr)=='\n' || (*ptr)=='\t')) ptr++;
+ if (strncmp(ptr,"<?xml",4) == 0) {
+ ptr= strstr(ptr,"?>");
+ if (ptr) ptr+=2; else {
+ rrd_set_error("Dangling XML header");
+ (*buf) = NULL;
+ return -1;
+ }
+ }
+ } while ((*buf)!=ptr);
+ return 1;
+}
+