mirror of
https://github.com/tstack/lnav
synced 2024-11-17 15:29:40 +00:00
fix -Wunused-result warnings when calling asprintf()
Fix these warnings: papertrail_proc.hh: In constructor ‘papertrail_proc::papertrail_proc(const string&, time_t, time_t)’: papertrail_proc.hh:107:36: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] this->ptp_api_key); ^ papertrail_proc.hh: In member function ‘void papertrail_proc::set_url()’: papertrail_proc.hh:146:47: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] this->ptp_quoted_search.in());
This commit is contained in:
parent
43ac6366cb
commit
7988200701
@ -102,9 +102,11 @@ public:
|
||||
this->ptp_search.c_str(),
|
||||
this->ptp_search.size());
|
||||
|
||||
asprintf(this->ptp_token_header.out(),
|
||||
if (asprintf(this->ptp_token_header.out(),
|
||||
"X-Papertrail-Token: %s",
|
||||
this->ptp_api_key);
|
||||
this->ptp_api_key) == -1) {
|
||||
perror("Failed to allocate X-Papertrail-Token string");
|
||||
}
|
||||
this->ptp_header_list = curl_slist_append(this->ptp_header_list,
|
||||
this->ptp_token_header.in());
|
||||
|
||||
@ -140,10 +142,12 @@ public:
|
||||
"max_time=%ld&",
|
||||
this->ptp_max_time);
|
||||
}
|
||||
asprintf(this->ptp_url.out(),
|
||||
if (asprintf(this->ptp_url.out(),
|
||||
"%sq=%s",
|
||||
base_url,
|
||||
this->ptp_quoted_search.in());
|
||||
this->ptp_quoted_search.in()) == -1) {
|
||||
perror("Failed to allocate ptp_url");
|
||||
}
|
||||
curl_easy_setopt(this->cr_handle, CURLOPT_URL, this->ptp_url.in());
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user