From: Jonathan W. <jw...@ju...> - 2017-03-21 01:16:33
|
Hi again Nils On Tue, Mar 21, 2017 at 10:42:19AM +1030, Jonathan Woithe wrote: > The cited change has possibly fixed whatever the "todo XXX" was working > around by chance. Rather than adding the call to ModelName.rstrip() > in saffire_dice.py, could you try testing the following patch instead? On second thoughts, maybe do this one instead since it ensures the string is null terminated even if the data returned by the interface is not. It's safer this way. Regards jonathan Index: configrom.cpp =================================================================== --- configrom.cpp (revision 2675) +++ configrom.cpp (working copy) @@ -179,9 +179,7 @@ while (*(buf + len - 1) == '\0') { len--; } - // \todo XXX seems a bit strage to do this but the nodemgr.c code does - // it. try to figure out why this is needed (or not) - buf[len++] = ' '; + // Ensure vendor string is null terminated buf[len] = '\0'; @@ -198,9 +196,7 @@ while (*(buf + len - 1) == '\0') { len--; } - // \todo XXX for edirol fa-66 it seems somehow broken. see above - // todo as well. - buf[len++] = ' '; + // Ensure model name string is null terminated buf[len] = '\0'; debugOutput( DEBUG_LEVEL_VERBOSE, "Model name: '%s'\n", buf); |