Thanks for all the responses. The character array rand did not have a null terminating character '\0', so the printf family of functions did not know where to stop when using %s. I handled it a bit differently and used someone's suggestion to print the hex value of each character instead of trying to treat it like a null terminated string. The reason I am printing the hex encoded value of each byte is because some of the bytes translate to non-printable characters.
Thanks, Axton On 8/7/07, Axton <[EMAIL PROTECTED]> wrote: > Here is another example of the logging randomness: > > +CALL ARFilterApiCall -- filter API ARSWIKI.ARF.PRNG > <ARSWIKI.ARF.PRNG> <INFO> ARFilterApiCall called by user Demo > <ARSWIKI.ARF.PRNG> <FINER> Random bytes: g*B=Ar{íp²&Demo > <ARSWIKI.ARF.PRNG> <FINEST> character 0: g > <ARSWIKI.ARF.PRNG> <FINER> int val of char 0: 103 > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 0 > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 103 > <ARSWIKI.ARF.PRNG> <FINEST> character 1: > <ARSWIKI.ARF.PRNG> <FINER> int val of char 1: 142 > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 8 > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 36352 > <ARSWIKI.ARF.PRNG> <FINEST> character 2: * > <ARSWIKI.ARF.PRNG> <FINER> int val of char 2: 42 > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 16 > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 2752512 > <ARSWIKI.ARF.PRNG> <FINEST> character 3: > <ARSWIKI.ARF.PRNG> <FINER> int val of char 3: 20 > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 24 > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 335544320 > <ARSWIKI.ARF.PRNG> <FINE> Random 32-bit int: 473730663 > <ARSWIKI.ARF.PRNG> <INFO> Received value: 2 > <ARSWIKI.ARF.PRNG> <INFO> Return Value (modulus): 0 > -CALL OK > > On 8/7/07, Axton <[EMAIL PROTECTED]> wrote: > > As another side note; I used automake and autoconf to create the > > configure and Makefile; if anyone can share information setting up > > Makefile.am and configure.ac properly for cross-platform/parallel > > building, do share. > > > > Thanks, > > Axton Grams > > > > On 8/7/07, Axton <[EMAIL PROTECTED]> wrote: > > > I know this is not the right forum, but you are the people I know. I > > > am working on an arfilter plug-in and have a question about C. The > > > plug-in I am writing randomly returns true or false based on a > > > probability (e.g., 1 in 10 chance T is returned). > > > > > > The output from the plug-in shows the following: > > > > > > <ARSWIKI.ARF.PRNG> <INFO> ARFilterApiCall called by user Demo > > > <ARSWIKI.ARF.PRNG> <FINER> Random bytes: i{¤ïÓÅ > > > <ARSWIKI.ARF.PRNG> <FINEST> character 0: > > > <ARSWIKI.ARF.PRNG> <FINER> int val of char 0: 134 > > > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 0 > > > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 134 > > > <ARSWIKI.ARF.PRNG> <FINEST> character 1: i > > > <ARSWIKI.ARF.PRNG> <FINER> int val of char 1: 105 > > > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 8 > > > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 26880 > > > <ARSWIKI.ARF.PRNG> <FINEST> character 2: { > > > <ARSWIKI.ARF.PRNG> <FINER> int val of char 2: 123 > > > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 16 > > > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 8060928 > > > <ARSWIKI.ARF.PRNG> <FINEST> character 3: ¤ > > > <ARSWIKI.ARF.PRNG> <FINER> int val of char 3: 164 > > > <ARSWIKI.ARF.PRNG> <FINEST> bit offset: 24 > > > <ARSWIKI.ARF.PRNG> <FINEST> after bit offset: 2751463424 > > > <ARSWIKI.ARF.PRNG> <FINE> Random 32-bit int: 2894948742 > > > <ARSWIKI.ARF.PRNG> <INFO> Received value: 2 > > > <ARSWIKI.ARF.PRNG> <INFO> Return Value: 1 > > > > > > The Random bytes line should contain 4 bytes of data, but for some > > > reason it returns between 4 and 8 bytes. > > > > > > The sources that retrive and log the value are available at: > > > http://arswiki.org/projects/arfprng/browser/trunk/lib/arfprng.c#L241 > > > > > > The program seems to work fine, but it worries me that I seem to be > > > reading memory I shouldn't be. Any help is appreciated. > > > > > > fwiw, the plug-in functions properly on linux, though there are a few > > > things I need to clean up before I consider it production worthy > > > (e.g., handling text values, handling zero as an input value, breaking > > > the code into functions, etc.). > > > > > > Main Page: http://arswiki.org/projects/arfprng > > > > > > As a partial side note, I installed the Doxygen plug-in for Trac; the > > > doxygen docs are available within the project web page. > > > > > > As another side note; there seem to be some undocumented functions > > > available that are exposed through ARPluginSetProperties: > > > > > > AR_PLUGIN_PROP_LOG_FUNCTION > > > AR_PLUGIN_PROP_INSTALL_DIR > > > AR_PLUGIN_PROP_CONFIG_FILE > > > AR_PLUGIN_PROP_GETUSER_FUNCTION > > > AR_PLUGIN_PROP_GETAUTHSTRING_FUNCTION > > > AR_PLUGIN_PROP_GETUSERAUTHINFO_FUNCTION > > > AR_PLUGIN_PROP_REGISTERSIGNALHANDLER_FUNCTION > > > AR_PLUGIN_PROP_INITTLS_FUNCTION > > > > > > Wondering if anyone had experimented with these and could share their > > > comments. > > > > > > Axton Grams > > > > > > _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are"