Permalink
Browse files

examples/certinfo.c: fix compiler warning

  • Loading branch information...
1 parent 2424b7a commit f947de4bb5c2d41ffd35f047c1f878820639c26a @yangtse yangtse committed Dec 29, 2012
Showing with 12 additions and 7 deletions.
  1. +12 −7 docs/examples/certinfo.c
View
19 docs/examples/certinfo.c
@@ -52,26 +52,31 @@ int main(void)
res = curl_easy_perform(curl);
if(!res) {
- struct curl_certinfo *ci = NULL;
+ union {
+ struct curl_slist *to_info;
+ struct curl_certinfo *to_certinfo;
+ } ptr;
- res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
+ ptr.to_info = NULL;
- if(!res && ci) {
+ res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ptr.to_info);
+
+ if(!res && ptr.to_info) {
int i;
- printf("%d certs!\n", ci->num_of_certs);
- for(i=0; i<ci->num_of_certs; i++) {
+ printf("%d certs!\n", ptr.to_certinfo->num_of_certs);
+
+ for(i = 0; i < ptr.to_certinfo->num_of_certs; i++) {
struct curl_slist *slist;
- for(slist = ci->certinfo[i]; slist; slist = slist->next)
+ for(slist = ptr.to_certinfo->certinfo[i]; slist; slist = slist->next)
printf("%s\n", slist->data);
}
}
}
-
curl_easy_cleanup(curl);
}

0 comments on commit f947de4

Please sign in to comment.