On Sep 1, 2015, at 4:26 AM, Paul Vermeer <[email protected]> wrote:
> 
> Hi nut users, (this is a re-send from the correct account)
>  
> With pleasure, I have been using the code provided. Managed to get all 
> working properly, except for the nutclient lib in C.

As you have noticed, nutclient has a few rough edges. The original upsclient 
library has had a lot more testing, although it is written in straight C.

Be careful with some of the other nutclient wrappers. There are try/catch 
blocks that mask exceptions.
 
> Both functions stringset_to_strarr and stringvector_to_strarr have a similar 
> bug in play. Although trivial in code, the coded function does not operate as 
> intended.
> The pointer increment is missing (see added line marked yellow below 
> [pstr++;]), which results in the same element being updated over and over 
> again, and then only leaving the last element of the list in the array.
 
I created an issue on Github to track this: 
https://github.com/networkupstools/nut/issues/232 
<https://github.com/networkupstools/nut/issues/232>

Should be easy to fix, but we also need to add some unit tests to keep this 
sort of thing from cropping up again.

> Kind regards, Paul Vermeer.
>  
>  
> (also I could not find out how to ‘install’ the include files properly using 
> the autogen.sh / .configure and make and make install scripts. – had to copy 
> them manually as I’m no expert in make scripts)
 
I was going to suggest that we should compare your settings to what Linux 
distributions do to package nutclient, but neither Debian nor Ubuntu has 
packaged it (only libupsclient*), and I haven't looked at other distributions 
yet. (This might be a sign...)

Which options are you passing to ./configure?

-- 
Charles Lepple
clepple@gmail



_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to