fixed bug in email address parsing
@@ -67,6 +67,12 @@ static char bufemail[128];
printf("uploading %s to %s\n", sendcapname, wpasecurl);
curl_global_init(CURL_GLOBAL_ALL);
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "file", CURLFORM_FILE, sendcapname, CURLFORM_END);
+if(emailheader != NULL)
+ {
+ snprintf(bufemail, 120, "email=%s", emailheader);
+ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "email", CURLFORM_PTRCONTENTS, bufemail, CURLFORM_END);
+ }
+
curl = curl_easy_init();
headerlist = curl_slist_append(headerlist, buf);
if(curl)
@@ -78,11 +84,6 @@ if(curl)
{
curl_easy_setopt(curl, CURLOPT_COOKIE, keyheader);
}
- if(emailheader != NULL)
- {
- snprintf(bufemail, 120, "email=%s", emailheader);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, bufemail);
- }
res = curl_easy_perform(curl);
if(res == CURLE_OK)
{
