Commit d28f526b1e5c7b87cfb9456902588679acf896f5

ckolivas 2011-06-23T17:56:11

Need memmem in advance() to work properly for patching.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/ocl.c b/ocl.c
index 6f845d4..5f29fd9 100644
--- a/ocl.c
+++ b/ocl.c
@@ -98,7 +98,8 @@ int clDevicesNum() {
 
 void advance(char **area, unsigned *remaining, const char *marker)
 {
-	char *find = strstr(*area, marker);
+	char *find = memmem(*area, *remaining, marker, strlen(marker));
+
 	if (!find)
 		fprintf(stderr, "Marker \"%s\" not found\n", marker), exit(1);
 	*remaining -= find - *area;