Changeset 9cb03bf


Ignore:
Timestamp:
Sep 28, 2009, 4:37:13 PM (11 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
fbadb37
Parents:
39cff48
Message:
get_zephyr_variable: Clean up const and NULL handling.

g_strdup and g_free already do the right thing with NULL, so we don’t
need extra logic here.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    rbb79a52 r9cb03bf  
    418418char *
    419419get_zephyr_variable(name)
    420         char *name;
     420        const char *name;
    421421        PREINIT:
    422422                char *result;
    423423        CODE:
    424                 result = (char *)owl_zephyr_get_variable(name);
    425                 result = result ? owl_strdup(result) : result;
     424                result = owl_strdup(owl_zephyr_get_variable(name));
    426425                RETVAL = result;
    427426        OUTPUT:
    428427                RETVAL
    429428        CLEANUP:
    430                 if(result)
    431                         owl_free(result);
     429                owl_free(result);
    432430
    433431MODULE = BarnOwl                PACKAGE = BarnOwl::Internal
Note: See TracChangeset for help on using the changeset viewer.