1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-01-27 15:25:24 -05:00

Replace malloc by allocate

This commit is contained in:
QC 2014-02-01 23:07:03 +01:00
parent 0737b4f5b2
commit bd3d69d1ae
2 changed files with 3 additions and 3 deletions

View file

@ -55,7 +55,7 @@ static char * escape_name( const char *mark, ssize_t *length )
{
// Escape the mark.
// Max length is twice the old size + trailing \0.
char *escaped_mark = malloc( sizeof( char )*( strlen( mark )*2+1 ) );
char *escaped_mark = allocate ( sizeof( char )*( strlen( mark )*2+1 ) );
ssize_t lm = strlen( mark );
*length = 0;
@ -185,7 +185,7 @@ static char ** get_mark ( )
t = recv( s, &head, sizeof( head ),0 );
if ( t == sizeof( head ) ) {
char *result = malloc( sizeof( char )*( head.size+1 ) );
char *result = allocate ( sizeof( char )*( head.size+1 ) );
ssize_t index = 0;
t = 0;

View file

@ -1480,7 +1480,7 @@ int main( int argc, char *argv[] )
if ( XrmGetResource ( xDB, name, class, &xrmType, &xrmValue ) ) {
if ( xrmOptions[i].type == xrm_String ) {
*xrmOptions[i].str = ( char * ) malloc ( xrmValue.size * sizeof ( char ) );
*xrmOptions[i].str = ( char * ) allocate ( xrmValue.size * sizeof ( char ) );
strncpy ( *xrmOptions[i].str, xrmValue.addr, xrmValue.size );
} else if ( xrmOptions[i].type == xrm_Number ) {
*xrmOptions[i].num = strtol ( xrmValue.addr, NULL, 10 );