<html>
<body>
<font size=3>At 02:41 AM 10/22/2024, Jim Klimov wrote:<br>
<blockquote type=cite class=cite cite="">Hello, always nice to hear about
new drivers :)<br><br>
OTOH, check for any variables you might have been re-using, so their
earlier state impacts later runs - whether buffers allocated statically
(or by caller without rewinding the pointer and maybe nulling the
contents), or position counters, etc. Similarly, be sure to
pre-initialize anything of value and not start out with random bits from
the stack.<br><br>
Also if it is about a series of calls - are there some (loop?) conditions
between the calls that might just preclude them from being called in the
first place?<br><br>
Old-school tracing with debug printouts is good in very many cases;
otherwise it can really help to stage a run in an IDE with a debugger.
Cross-platform wise, I've had consistently good experience with NetBeans
(installing the C/C++ plugin from the NB 8.2 archive after every NB
upgrade is a PITA though); VSCode also worked (at least when I drilled
into NUT for Windows builds with MSYS2) - hints on both are in NUT
docs.<br><br>
Hope this helps,<br>
Jim Klimov<br><br>
<br><br>
On Tue, Oct 22, 2024 at 5:01 AM William R. Elliot
<<a href="mailto:bill@wreassoc.com">bill@wreassoc.com</a>>
wrote:<br>
</font>
<dl>
<dd>Hello all,<br><br>
<dd>In my new driver I have a function that searches for the position of
<br>
<dd>a known substring in a delimited string. I am trying to populate a
<br>
<dd>series of integer variables with the position value of various <br>
<dd>substrings. The first call to the function performs correctly but the
<br>
<dd>remaining calls in the code series are not being executed (there are
<br>
<dd>six more calls after the first successful one). Any ideas why only
<br>
<dd>the first call is being done?<br><br>
<dd>Similarly, I have another function that takes a position variable and
<br>
<dd>pulls the data in the nth position from a delimited string. There is
<br>
<dd>also a series of these called in a row and only the first is being
called.<br><br>
<dd>Any ideas on what to look for would be appreciated.<br><br>
<dd>Thanks,<br><br>
<dd>Bill<br><br>
<br><br>
<dd>-- <br>
<dd>This email has been checked for viruses by AVG antivirus
software.<br>
<dd><a href="http://www.avg.com">www.avg.com</a><br><br>
<dd>_______________________________________________<br>
<dd>Nut-upsdev mailing list<br>
<dd><a href="mailto:Nut-upsdev@alioth-lists.debian.net">
Nut-upsdev@alioth-lists.debian.net</a><br>
<dd>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev" eudora="autourl">
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev</a>
<br>
</blockquote>
</dl><br><br>
<font size=3>Thanks for the response Jim.<br><br>
The problem had to do with my mis-understanding of the strtok library
function internals. Making a local copy of the source string in my
function(s) solved the problem as the source buffer was getting whacked
by strtok.<br><br>
Moving on.<br><br>
Bill<br><br>
</font><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /><table style="border-top: 1px solid #D3D4DE;"><tr><td style="width: 55px; padding-top: 13px;"><a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-green-avg-v1.png" alt="" width="46" height="29" style="width: 46px; height: 29px;"/></a></td><td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free.<a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avg.com</a></td></tr></table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>