Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning fixes #1227

Closed
wants to merge 2 commits into from
Closed

Warning fixes #1227

wants to merge 2 commits into from

Conversation

ricardomaraschini
Copy link
Contributor

Some warning fixes.

if asprintf fails, string content becomes invalid. we need
to check if it ran OK by checking the returned value.

in case of fail, asprintf returns -1, otherwise the number
of writen bytes is returned.

also, on ubuntu 13.10 i've receiving a lot of warnings:

"warning: ignoring return value of ‘asprintf’"

this patches fixes some of them

Signed-off-by: Ricardo Maraschini <ricardo.maraschini@gmail.com>
while compiling i keep receiving an warning statement as follow:

warning: zero-length gnu_printf format string

using an unorthodox method to remove them

Signed-off-by: Ricardo Maraschini <ricardo.maraschini@gmail.com>
@weiss
Copy link
Member

weiss commented Jan 22, 2014

We have an xasprintf() function in plugins/utils.c, we should just use that consistently across the code.

But I like the " \b" hack! :-)

@skottler
Copy link

Any update on this @ricardomaraschini?

@waja
Copy link
Member

waja commented Jul 30, 2014

the latter patch was merged by 82033b3

waja pushed a commit to waja/monitoring-plugins that referenced this pull request Jul 30, 2014
if asprintf fails, string content becomes invalid. we need
to check if it ran OK by checking the returned value.

in case of fail, asprintf returns -1, otherwise the number
of writen bytes is returned.

also, on ubuntu 13.10 i've receiving a lot of warnings:

"warning: ignoring return value of ‘asprintf’"

this patches fixes some of them

Signed-off-by: Ricardo Maraschini <ricardo.maraschini@gmail.com>
---
Closes monitoring-plugins#1227
@waja waja closed this in #1278 Jul 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants