Changeset 34759e6


Ignore:
Timestamp:
2005-12-10T15:28:41Z (14 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
1aa0bb5, d3307e2
Parents:
9df916f
Message:

Use more GLib functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • crypting.c

    r9df916f r34759e6  
    108108}
    109109
    110 char *obfucrypt (irc_t *irc, char *line) {
     110char *obfucrypt (irc_t *irc, char *line)
     111{
    111112        int i, j;
    112113        char *rv;
     
    114115        if (irc->password == NULL) return (NULL);
    115116       
    116         rv = (char *)g_malloc (strlen (line) + 1);
    117         memset (rv, '\0', strlen (line) + 1);
     117        rv = g_new0(char, strlen (line) + 1);
    118118       
    119119        i = j = 0;
     
    133133}
    134134
    135 char *deobfucrypt (irc_t *irc, char *line) {
     135char *deobfucrypt (irc_t *irc, char *line)
     136{
    136137        int i, j;
    137138        char *rv;
     
    139140        if (irc->password == NULL) return (NULL);
    140141       
    141         rv = (char *)g_malloc (strlen (line) + 1);
    142         memset (rv, '\0', strlen (line) + 1);
     142        rv = g_new0(char, strlen (line) + 1);
    143143       
    144144        i = j = 0;
     
    162162int main( int argc, char *argv[] )
    163163{
    164         irc_t *irc = g_malloc( sizeof( irc_t ) );
     164        irc_t *irc = g_new0( irc_t, 1 );
    165165        char *hash, *action, line[256];
    166166        char* (*func)( irc_t *, char * );
     
    174174        }
    175175       
    176         memset( irc, 0, sizeof( irc_t ) );
    177176        irc->password = g_strdup( argv[1] );
    178177       
Note: See TracChangeset for help on using the changeset viewer.