Parse a GET or POST string in C
The easiest way to improve this function is to use the C standard library. As it is, it's difficult to read; you can't understand what it does at a glance. And it's unnecessary difficult, because most of the building blocks are already available for free in &lt;string.h&gt;:


find a string in another string with strstr;
find a character in a string with strchr;
copy a string with strcpy or a substring with memcpy


Once you have simplified your code, you'll have more brain space to care for not so negligeable things such as testing memory allocations:

void httpString(char **dest, char *input, const char *find) {
    char* found = strstr(input, find);
    if (!found) {
        printf("find not found!");
        return;
    }
    char* assign = found + strlen(find);
    if (*assign != '=') {
        printf("ill-formed!");
        return;
    }
    char* value = assign + 1;
    char* end_value = strchr(value, '&amp;');
    if (!end_value) end_value = strchr(value, 0);
    int length = end_value - value;

    *dest = (char*) malloc(length + 1);
    if (!*dest) {
        printf("Not enough memory");
        return;
    }
    memcpy(*dest, value, length);
    (*dest)[length] = 0;
}