md5.c
changeset 148 8a5cf98a00b6
parent 77 49e0babccb23
child 162 fad55be2d07c
equal deleted inserted replaced
147:f9015072361f 148:8a5cf98a00b6
    27     }
    27     }
    28 
    28 
    29     /*
    29     /*
    30      * MD5 alters the input buffer
    30      * MD5 alters the input buffer
    31      */
    31      */
    32     strcpy (buffer, argv[1]);
    32     strncpy (buffer, argv[1], sizeof (buffer));
    33     strcpy (text, argv[1]);
    33     strncpy (text, argv[1], sizeof (buffer));
    34 
    34 
    35     md5_hash = MD5 ((u_char *) buffer, strlen (buffer), NULL);
    35     md5_hash = MD5 ((u_char *) buffer, strlen (buffer), NULL);
    36 
    36 
    37     for (i = 0, j = 0; i < 16; i++) {
    37     for (i = 0, j = 0; i < 16; i++) {
    38         sprintf (byte, "%02x", (md5_hash[i] & 0xFF));
    38         sprintf (byte, "%02x", (md5_hash[i] & 0xFF));