]> git.zerfleddert.de Git - record-dvb/blobdiff - http.c
more http-checks, some fixes
[record-dvb] / http.c
diff --git a/http.c b/http.c
index eee73454e763b0b5d5770954cfeeb7a146e8cad3..ab798d9956f64cd55ee030d05fe45a3cd101cd29 100644 (file)
--- a/http.c
+++ b/http.c
@@ -91,8 +91,7 @@ int open_http(char *url)
 
                                pos = buffer;
                                while (*pos != 0) {
-                                       if (*pos == ' ') {
-                                               pos++;
+                                       if (*(pos++) == ' ') {
                                                if(strncmp("200", pos, 3)) {
                                                        fprintf(stderr, "Wrong result-code: %s\n", buffer);
                                                        return -1;
@@ -100,7 +99,11 @@ int open_http(char *url)
                                                        break;
                                                }
                                        }
-                                       pos++;
+
+                                       if (*(++pos) == 0) {
+                                               fprintf(stderr, "Wrong answer from server: %s\n", buffer);
+                                               return -1;
+                                       }
                                }
                        }
 
Impressum, Datenschutz