Convert output from MD5 to printable ascii

Discussion in 'C Programming' started by Serman D., Feb 23, 2007.

  1. Serman D.

    Serman D. Guest

    Hi,

    I have very limited C knowledge. I want to convert to output from a
    MD5 hash algorithm to printable ascii similar to the output of the
    md5sum in GNU coreutils. Any help on how to do the conversion is
    appreciated.

    [aff@afflinux md5_xyssl]$ gcc -o test test.c md5.c
    [aff@afflinux md5_xyssl]$ ./test
    "J?n??CBW? ?}"
    [aff@afflinux md5_xyssl]$ echo "This is my dearest secret: 12345" |
    md5sum
    749226c29c17114562745d9769fdab45 -
    [aff@afflinux md5_xyssl]$

    $ md5sum --version
    md5sum (coreutils) 5.2.1

    /*
    * test.c
    *
    * MD5 source from http://xyssl.org/code/source/md5/
    *
    */

    #include "md5.h"
    #include <string.h>

    int main (void) {

    unsigned char in[64] = "This is my dearest secret: 12345";
    unsigned char *pout;

    // compute MD5 hash
    md5_csum(in, 64, pout);

    printf("\"%s\"\n", pout);
    }
     
    Serman D., Feb 23, 2007
    #1
    1. Advertising

  2. Serman D.

    santosh Guest

    Serman D. wrote:
    > Hi,
    >
    > I have very limited C knowledge. I want to convert to output from a
    > MD5 hash algorithm to printable ascii similar to the output of the
    > md5sum in GNU coreutils. Any help on how to do the conversion is
    > appreciated.


    Use printf with the %x or %X format specifier. Access the hash as an
    array of unsigned char. Also the md5sum library may itself provide
    formatting routines.
     
    santosh, Feb 23, 2007
    #2
    1. Advertising

  3. Serman D.

    Daniel Rudy Guest

    At about the time of 2/23/2007 12:58 AM, Serman D. stated the following:
    > Hi,
    >
    > I have very limited C knowledge. I want to convert to output from a
    > MD5 hash algorithm to printable ascii similar to the output of the
    > md5sum in GNU coreutils. Any help on how to do the conversion is
    > appreciated.
    >
    > [aff@afflinux md5_xyssl]$ gcc -o test test.c md5.c
    > [aff@afflinux md5_xyssl]$ ./test
    > "J?n??CBW? ?}"
    > [aff@afflinux md5_xyssl]$ echo "This is my dearest secret: 12345" |
    > md5sum
    > 749226c29c17114562745d9769fdab45 -
    > [aff@afflinux md5_xyssl]$
    >
    > $ md5sum --version
    > md5sum (coreutils) 5.2.1
    >
    > /*
    > * test.c
    > *
    > * MD5 source from http://xyssl.org/code/source/md5/
    > *
    > */
    >
    > #include "md5.h"
    > #include <string.h>
    >
    > int main (void) {
    >
    > unsigned char in[64] = "This is my dearest secret: 12345";
    > unsigned char *pout;
    >
    > // compute MD5 hash
    > md5_csum(in, 64, pout);
    >
    > printf("\"%s\"\n", pout);
    > }
    >



    int i;

    for (i = 0; i < 16; i++) printf("%0x", pout);
    printf("\n");

    I use 16 because MD6 hashes are 128 bits or 16 bytes long. This is
    assuming an Intel platform.

    --
    Daniel Rudy

    Email address has been base64 encoded to reduce spam
    Decode email address using b64decode or uudecode -m

    Why geeks like computers: look chat date touch grep make unzip
    strip view finger mount fcsk more fcsk yes spray umount sleep
     
    Daniel Rudy, Feb 23, 2007
    #3
  4. Serman D.

    Serman D. Guest

    On Feb 23, 10:49 am, Daniel Rudy <> wrote:
    > At about the time of 2/23/2007 12:58 AM, Serman D. stated the following:
    > > int main (void) {

    >
    > > unsigned char in[64] = "This is my dearest secret: 12345";
    > > unsigned char *pout;

    >
    > > // compute MD5 hash
    > > md5_csum(in, 64, pout);

    >
    > > printf("\"%s\"\n", pout);
    > > }

    >
    > int i;
    > for (i = 0; i < 16; i++) printf("%0x", pout);
    > printf("\n");


    Thanks Daniel,

    Follow-up question:

    How do I copy the contents to a string (unsigned char pointer)
    variable instead of printing to stdout?

    I'm completely lost in the C jungle of string manipulation..

    --
    Serman D.
     
    Serman D., Feb 23, 2007
    #4
  5. Serman D.

    Guest

    On Feb 23, 11:44 am, "Serman D." <> wrote:
    > How do I copy the contents to a string (unsigned char pointer)
    > variable instead of printing to stdout?


    sprintf()
     
    , Feb 23, 2007
    #5
  6. Serman D.

    Daniel Rudy Guest

    At about the time of 2/23/2007 3:44 AM, Serman D. stated the following:
    > On Feb 23, 10:49 am, Daniel Rudy <> wrote:
    >> At about the time of 2/23/2007 12:58 AM, Serman D. stated the following:
    >>> int main (void) {
    >>> unsigned char in[64] = "This is my dearest secret: 12345";
    >>> unsigned char *pout;
    >>> // compute MD5 hash
    >>> md5_csum(in, 64, pout);
    >>> printf("\"%s\"\n", pout);
    >>> }

    >> int i;
    >> for (i = 0; i < 16; i++) printf("%0x", pout);
    >> printf("\n");

    >
    > Thanks Daniel,
    >
    > Follow-up question:
    >
    > How do I copy the contents to a string (unsigned char pointer)
    > variable instead of printing to stdout?
    >
    > I'm completely lost in the C jungle of string manipulation..
    >
    > --
    > Serman D.
    >


    The BIG thing you need to realize here is that strings in C are null
    terminated (ASCII 0). The output of MD5 is BINARY, so for an unsigned
    char, all values 0-255 are valid data...this includes the 0 or null char
    for string termination. There's a set of functions that is used to
    handle binary strings. To copy binary strings, take a look at memcpy or
    memmove.

    Something like:

    unsigned char dst[16];
    memcpy(dst, pout, 16);

    Since the data is binary, there is no terminating null. You just have
    to be careful when working with it and use the size correctly. The best
    way to do this would be like this:

    #include <stdio.h>
    #include <string.h>
    #include "md5.h"

    #define MD5HASHSIZE 16

    int main (void) {

    unsigned char in[64] = "This is my dearest secret: 12345";
    unsigned char *pout;
    unsigned char dest[MD5HASHSIZE];
    int i;

    // compute MD5 hash
    md5_csum(in, 64, pout);

    printf("\"%s\"\n", pout);

    for (i = 0; i < MD5HASHSIZE; i++) printf("%0x", pout);
    printf("\n");

    memmove(dest, pout, MD5HASHSIZE);

    return(0);
    }

    Note the #define directive. The pre-processor will replace all
    instances of MD5HASHSIZE with 16. So if you change the value of
    MD5HASHSIZE, it will change everywhere so you don't have to go through
    your code and change each instance manually. Think of it as a constant.
    It's not a const, but it's like a const.

    I'm sure that someone will correct me on this....
    --
    Daniel Rudy

    Email address has been base64 encoded to reduce spam
    Decode email address using b64decode or uudecode -m

    Why geeks like computers: look chat date touch grep make unzip
    strip view finger mount fcsk more fcsk yes spray umount sleep
     
    Daniel Rudy, Feb 23, 2007
    #6
  7. Serman D.

    Daniel Rudy Guest

    At about the time of 2/23/2007 3:44 AM, Serman D. stated the following:
    > On Feb 23, 10:49 am, Daniel Rudy <> wrote:
    >> At about the time of 2/23/2007 12:58 AM, Serman D. stated the following:
    >>> int main (void) {
    >>> unsigned char in[64] = "This is my dearest secret: 12345";
    >>> unsigned char *pout;
    >>> // compute MD5 hash
    >>> md5_csum(in, 64, pout);
    >>> printf("\"%s\"\n", pout);
    >>> }

    >> int i;
    >> for (i = 0; i < 16; i++) printf("%0x", pout);
    >> printf("\n");

    >
    > Thanks Daniel,
    >
    > Follow-up question:
    >
    > How do I copy the contents to a string (unsigned char pointer)
    > variable instead of printing to stdout?
    >
    > I'm completely lost in the C jungle of string manipulation..
    >
    > --
    > Serman D.
    >


    Disreguard my other post. I misunderstood what you were refering too.

    int i;
    char c[10];
    char md5ascii[128];

    memset(md5ascii, 0, sizeof(md5ascii);
    for (i = 0; i < 16; i++)
    {
    snprintf(c, sizeof(c), "%0x", pout;
    strncat(md5ascii, c, sizeof(md5ascii) - 1;
    }



    --
    Daniel Rudy

    Email address has been base64 encoded to reduce spam
    Decode email address using b64decode or uudecode -m

    Why geeks like computers: look chat date touch grep make unzip
    strip view finger mount fcsk more fcsk yes spray umount sleep
     
    Daniel Rudy, Feb 23, 2007
    #7
  8. Serman D.

    santosh Guest

    Daniel Rudy wrote:
    > At about the time of 2/23/2007 3:44 AM, Serman D. stated the following:


    <snip>

    > > Follow-up question:
    > >
    > > How do I copy the contents to a string (unsigned char pointer)
    > > variable instead of printing to stdout?

    [ ... ]

    > Disreguard my other post. I misunderstood what you were refering too.
    >
    > int i;
    > char c[10];
    > char md5ascii[128];
    >
    > memset(md5ascii, 0, sizeof(md5ascii);
    > for (i = 0; i < 16; i++)
    > {
    > snprintf(c, sizeof(c), "%0x", pout;
    > strncat(md5ascii, c, sizeof(md5ascii) - 1;
    > }


    Hacked out on the spot eh? You've forgotten to close the argument list
    for memset, snprintf and strncat. Required headers, definition of pout
    and main are missing. Here's a compilable example based on yours:

    #include <stdio.h>
    #include <string.h>

    int i;
    char c[10];
    char md5ascii[128];
    unsigned char pout[16];

    int main(void) {
    for(i = 0; i < sizeof(pout); i++) pout = i + 1;

    memset(md5ascii, 0, sizeof(md5ascii));
    for (i = 0; i < 16; i++) {
    snprintf(c, sizeof(c), "%0x", pout);
    strncat(md5ascii, c, sizeof(md5ascii) - 1);
    }

    for(i = 0; i < sizeof(md5ascii); i++) putchar(md5ascii);

    putchar('\n');
    return 0;
    }
     
    santosh, Feb 23, 2007
    #8
  9. Serman D.

    Daniel Rudy Guest

    At about the time of 2/23/2007 10:05 AM, santosh stated the following:
    > Daniel Rudy wrote:
    >> At about the time of 2/23/2007 3:44 AM, Serman D. stated the following:

    >
    > <snip>
    >
    >>> Follow-up question:
    >>>
    >>> How do I copy the contents to a string (unsigned char pointer)
    >>> variable instead of printing to stdout?

    > [ ... ]
    >
    >> Disreguard my other post. I misunderstood what you were refering too.
    >>
    >> int i;
    >> char c[10];
    >> char md5ascii[128];
    >>
    >> memset(md5ascii, 0, sizeof(md5ascii);
    >> for (i = 0; i < 16; i++)
    >> {
    >> snprintf(c, sizeof(c), "%0x", pout;
    >> strncat(md5ascii, c, sizeof(md5ascii) - 1;
    >> }

    >
    > Hacked out on the spot eh?


    Pretty much. :) That's what happens when you are up since 1 in the AM.

    > You've forgotten to close the argument list
    > for memset, snprintf and strncat. Required headers, definition of pout
    > and main are missing. Here's a compilable example based on yours:
    >
    > #include <stdio.h>
    > #include <string.h>
    >
    > int i;
    > char c[10];
    > char md5ascii[128];
    > unsigned char pout[16];
    >
    > int main(void) {
    > for(i = 0; i < sizeof(pout); i++) pout = i + 1;
    >
    > memset(md5ascii, 0, sizeof(md5ascii));
    > for (i = 0; i < 16; i++) {
    > snprintf(c, sizeof(c), "%0x", pout);
    > strncat(md5ascii, c, sizeof(md5ascii) - 1);
    > }
    >
    > for(i = 0; i < sizeof(md5ascii); i++) putchar(md5ascii);
    >
    > putchar('\n');
    > return 0;
    > }
    >


    Opps.

    Looks like my secret is out. I guess you can tell that I rely on
    compiler warnings and errors *way* too much.

    --
    Daniel Rudy

    Email address has been base64 encoded to reduce spam
    Decode email address using b64decode or uudecode -m

    Why geeks like computers: look chat date touch grep make unzip
    strip view finger mount fcsk more fcsk yes spray umount sleep
     
    Daniel Rudy, Feb 24, 2007
    #9
  10. Serman D.

    Guest

    On Feb 23, 1:49 am, Daniel Rudy <> wrote:
    > At about the time of 2/23/2007 12:58 AM, Serman D. stated the
    > following:
    > > I have very limited C knowledge. I want to convert to output from a
    > > MD5 hash algorithm to printable ascii similar to the output of the
    > > md5sum in GNU coreutils. Any help on how to do the conversion is
    > > appreciated.

    >
    > > [aff@afflinux md5_xyssl]$ gcc -o test test.c md5.c
    > > [aff@afflinux md5_xyssl]$ ./test
    > > "J?n??CBW? ?}"
    > > [aff@afflinux md5_xyssl]$ echo "This is my dearest secret: 12345" |
    > > md5sum
    > > 749226c29c17114562745d9769fdab45 -
    > > [aff@afflinux md5_xyssl]$

    >
    > > $ md5sum --version
    > > md5sum (coreutils) 5.2.1

    >
    > > /*
    > > * test.c
    > > *
    > > * MD5 source fromhttp://xyssl.org/code/source/md5/
    > > *
    > > */

    >
    > > #include "md5.h"
    > > #include <string.h>

    >
    > > int main (void) {

    >
    > > unsigned char in[64] = "This is my dearest secret: 12345";
    > > unsigned char *pout;

    >
    > > // compute MD5 hash
    > > md5_csum(in, 64, pout);

    >
    > > printf("\"%s\"\n", pout);
    > > }

    >
    > int i;
    >
    > for (i = 0; i < 16; i++) printf("%0x", pout);
    > printf("\n");


    Let's try:

    for (i=0; i < 16; i++) printf ("%02x", pout);
    printf ("\n");

    The difference kind of matters.

    However, I would, of course, just do this:

    char out[33], *p;
    for (p=out,i=0; i < 16; i++) {
    *p++ = "0123456789ABCDEF"[(pout >> 4) & 0xf];
    *p++ = "0123456789ABCDEF"[pout & 0xf];
    }
    *p = '\0';
    puts (out);

    to avoid linking in all of printf() unnecessarily.

    --
    Paul Hsieh
    http://www.pobox.com/~qed/
    http://bstring.sf.net/
     
    , Feb 24, 2007
    #10
  11. writes:
    [...]
    > However, I would, of course, just do this:
    >
    > char out[33], *p;
    > for (p=out,i=0; i < 16; i++) {
    > *p++ = "0123456789ABCDEF"[(pout >> 4) & 0xf];
    > *p++ = "0123456789ABCDEF"[pout & 0xf];
    > }
    > *p = '\0';
    > puts (out);
    >
    > to avoid linking in all of printf() unnecessarily.


    I presume you would first confirm that (a) the use of puts() doesn't
    cause printf() to be linked in anyway on target implementations of
    interest, and (b) the measured saving in final code size is actually
    worth the additional effort (including testing the code to make sure
    you got it right).

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 24, 2007
    #11
  12. In article <>,
    Keith Thompson <> wrote:
    > writes:
    >[...]
    >> However, I would, of course, just do this:
    >>
    >> char out[33], *p;
    >> for (p=out,i=0; i < 16; i++) {
    >> *p++ = "0123456789ABCDEF"[(pout >> 4) & 0xf];
    >> *p++ = "0123456789ABCDEF"[pout & 0xf];
    >> }
    >> *p = '\0';
    >> puts (out);
    >>
    >> to avoid linking in all of printf() unnecessarily.

    >
    >I presume you would first confirm that (a) the use of puts() doesn't
    >cause printf() to be linked in anyway on target implementations of
    >interest, and (b) the measured saving in final code size is actually
    >worth the additional effort (including testing the code to make sure
    >you got it right).


    Keithie, baby. Seriously. You need to get thee to www.senseofhumor.com
    and buy one online. Whatever they're charging, it'll be worth it.
    Trust me on this.
     
    Kenny McCormack, Feb 24, 2007
    #12
  13. Serman D.

    Guest

    On Feb 24, 1:42 pm, Keith Thompson <> wrote:
    > writes:
    > > However, I would, of course, just do this:
    > > char out[33], *p;
    > > for (p=out,i=0; i < 16; i++) {
    > > *p++ = "0123456789ABCDEF"[(pout >> 4) & 0xf];
    > > *p++ = "0123456789ABCDEF"[pout & 0xf];
    > > }
    > > *p = '\0';
    > > puts (out);

    >
    > > to avoid linking in all of printf() unnecessarily.

    >
    > I presume you would first confirm that (a) the use of puts() doesn't
    > cause printf() to be linked in anyway on target implementations of
    > interest,


    Well, I don't know what quality of implementations you are used to.
    All the compilers I use basically do link these seperately. The
    reason is that printf is a gargantuan link-in in comparison to puts.

    > [...] and (b) the measured saving in final code size is actually
    > worth the additional effort


    printf needs to link in double -> ASCII conversion. This cannot be
    avoided unless the compiler really translates the format string at
    compile time (which only gcc seems to bother trying) which itself is
    risky since someone might want to override the implementation of
    printf (which may not be standard endorsed, but it doesn't change the
    fact that people want to do that.)

    > [...] (including testing the code to make sure you got it right).


    Ironic that you suggest testing (is that mentioned somewhere in the
    standard?) Daniel Rudy's code would have passed *some* testing while
    still being wrong. Furthermore if you are unable to figure it out
    logically, then *where* it is failing is on the inside printf's object
    code, which in many compiler's debuggers you can't trace through. If
    there's anything wrong in the code I showed, it will be pretty obvious
    pretty quickly.

    --
    Paul Hsieh
    http://www.pobox.com/~qed/
    http://bstring.sf.net/
     
    , Feb 25, 2007
    #13
  14. Serman D.

    santosh Guest

    OT - Re: Convert output from MD5 to printable ascii

    Keith Thompson wrote:
    > writes:
    > [...]
    > > However, I would, of course, just do this:
    > >
    > > char out[33], *p;
    > > for (p=out,i=0; i < 16; i++) {
    > > *p++ = "0123456789ABCDEF"[(pout >> 4) & 0xf];
    > > *p++ = "0123456789ABCDEF"[pout & 0xf];
    > > }
    > > *p = '\0';
    > > puts (out);
    > >
    > > to avoid linking in all of printf() unnecessarily.

    >
    > I presume you would first confirm that (a) the use of puts() doesn't
    > cause printf() to be linked in anyway on target implementations of
    > interest, and (b) the measured saving in final code size is actually
    > worth the additional effort (including testing the code to make sure
    > you got it right).


    Interestingly, over here, (gcc 4.0.3 on an i686 Linux), gcc will emit
    a call to puts for the corresponding printf invocation when the first
    argument contains no format specifiers. This is done even when
    optimisations are disabled.

    I was able to turn of this "feature" by using a char pointer
    initialised to string literal instead of the latter. In this case the
    function mentioned in the source is called, whether it be printf or
    puts.

    Also linking in puts in the place of printf did nothing to reduce the
    object code size. This probably means that printf and puts are in the
    same object module and hence linked in together. I haven't actually
    checked that.
     
    santosh, Feb 25, 2007
    #14
  15. Serman D.

    Ben Pfaff Guest

    Re: OT - Re: Convert output from MD5 to printable ascii

    "santosh" <> writes:

    > Interestingly, over here, (gcc 4.0.3 on an i686 Linux), gcc will emit
    > a call to puts for the corresponding printf invocation when the first
    > argument contains no format specifiers. This is done even when
    > optimisations are disabled.


    I hope it does that only when the format string ends in a
    new-line character.
    --
    "Your correction is 100% correct and 0% helpful. Well done!"
    --Richard Heathfield
     
    Ben Pfaff, Feb 25, 2007
    #15
  16. Serman D.

    santosh Guest

    Re: OT - Re: Convert output from MD5 to printable ascii

    Ben Pfaff wrote:
    > "santosh" <> writes:
    >
    > > Interestingly, over here, (gcc 4.0.3 on an i686 Linux), gcc will emit
    > > a call to puts for the corresponding printf invocation when the first
    > > argument contains no format specifiers. This is done even when
    > > optimisations are disabled.

    >
    > I hope it does that only when the format string ends in a
    > new-line character.


    It seems to do as you say. Why that requirement?
     
    santosh, Feb 25, 2007
    #16
  17. Serman D.

    Flash Gordon Guest

    Re: OT - Re: Convert output from MD5 to printable ascii

    santosh wrote, On 25/02/07 08:56:
    > Ben Pfaff wrote:
    >> "santosh" <> writes:
    >>
    >>> Interestingly, over here, (gcc 4.0.3 on an i686 Linux), gcc will emit
    >>> a call to puts for the corresponding printf invocation when the first
    >>> argument contains no format specifiers. This is done even when
    >>> optimisations are disabled.

    >> I hope it does that only when the format string ends in a
    >> new-line character.

    >
    > It seems to do as you say. Why that requirement?


    Because puts appends a newline character, so it can't be used when you
    want to print a partial line not ending in a newline (possibly because
    some other part of the program will print the rest of the line).
    --
    Flash Gordon
     
    Flash Gordon, Feb 25, 2007
    #17
  18. Re: OT - Re: Convert output from MD5 to printable ascii

    "santosh" <> schrieb im Newsbeitrag
    news:...
    >
    > Ben Pfaff wrote:
    >> "santosh" <> writes:
    >>
    >> > Interestingly, over here, (gcc 4.0.3 on an i686 Linux), gcc will emit
    >> > a call to puts for the corresponding printf invocation when the first
    >> > argument contains no format specifiers. This is done even when
    >> > optimisations are disabled.

    >>
    >> I hope it does that only when the format string ends in a
    >> new-line character.

    >
    > It seems to do as you say. Why that requirement?

    Because puts() appends a newline to the string it prints. It printf() hadn't
    been told to add a newline, and would use puts() to do the printing, that
    would add a newline, rendering the printf() behavoir non-conforming.

    Bye, Jojo
     
    Joachim Schmitz, Feb 25, 2007
    #18
  19. Serman D.

    santosh Guest

    Re: OT - Re: Convert output from MD5 to printable ascii

    Flash Gordon wrote:
    > santosh wrote, On 25/02/07 08:56:
    > > Ben Pfaff wrote:
    > >> "santosh" <> writes:
    > >>
    > >>> Interestingly, over here, (gcc 4.0.3 on an i686 Linux), gcc will emit
    > >>> a call to puts for the corresponding printf invocation when the first
    > >>> argument contains no format specifiers. This is done even when
    > >>> optimisations are disabled.
    > >>
    > >> I hope it does that only when the format string ends in a
    > >> new-line character.

    > >
    > > It seems to do as you say. Why that requirement?

    >
    > Because puts appends a newline character, so it can't be used when you
    > want to print a partial line not ending in a newline (possibly because
    > some other part of the program will print the rest of the line).


    Thanks. I see it now.
     
    santosh, Feb 25, 2007
    #19
  20. Serman D.

    Randy Howard Guest

    On Sat, 24 Feb 2007 22:13:21 -0600, wrote
    (in article <>):

    > On Feb 24, 1:42 pm, Keith Thompson <> wrote:
    >> writes:
    >>> However, I would, of course, just do this:
    >>> char out[33], *p;
    >>> for (p=out,i=0; i < 16; i++) {
    >>> *p++ = "0123456789ABCDEF"[(pout >> 4) & 0xf];
    >>> *p++ = "0123456789ABCDEF"[pout & 0xf];
    >>> }
    >>> *p = '\0';
    >>> puts (out);

    >>
    >>> to avoid linking in all of printf() unnecessarily.

    >>
    >> I presume you would first confirm that (a) the use of puts() doesn't
    >> cause printf() to be linked in anyway on target implementations of
    >> interest,

    >
    > Well, I don't know what quality of implementations you are used to.
    > All the compilers I use basically do link these seperately. The
    > reason is that printf is a gargantuan link-in in comparison to puts.


    I just tried this with gcc 4.0.1 using gcc on a Hello, World program
    with printf and puts on OS X. The output size is exactly the same.
    So, I used a slightly trickier printf() call that shouldn't be switched
    out to a straight puts(), and that output file went up by 4284 bytes.

    Outside of embedded land, that is completely meaningless.

    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
     
    Randy Howard, Mar 10, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim
    Replies:
    4
    Views:
    516
  2. Daniel Alexandre
    Replies:
    2
    Views:
    561
    Sibylle Koczian
    Mar 21, 2005
  3. Replies:
    9
    Views:
    17,108
    John Salerno
    May 8, 2006
  4. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    219
    Brian Candler
    Nov 21, 2008
  5. Jack
    Replies:
    2
    Views:
    125
    Bart Van der Donck
    Jul 18, 2006
Loading...

Share This Page