Changeset 47e0a6a for global.c


Ignore:
Timestamp:
Mar 24, 2011, 4:10:53 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
283ff1e
Parents:
d07af84
git-author:
David Benjamin <davidben@mit.edu> (03/11/11 00:17:26)
git-committer:
David Benjamin <davidben@mit.edu> (03/24/11 16:10:53)
Message:
Punt a number of g_new NULL checks, various minor cleanups

No real need to check g_new's return value as it always succeeds. (Or
destroys the universe^Wprocess in embarrassment.) Also make owl_global
manage the lifetime of the kill buffer since it's part of owl_global
now. And replace a g_new/strncpy with a g_strndup. It's shorter.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    rf25df21 r47e0a6a  
    957957}
    958958
    959 char *owl_global_get_kill_buffer(owl_global *g) {
     959const char *owl_global_get_kill_buffer(owl_global *g) {
    960960  return g->kill_buffer;
    961961}
    962962
    963 void owl_global_set_kill_buffer(owl_global *g,char *kill) {
    964   g->kill_buffer = kill;
    965 }
     963void owl_global_set_kill_buffer(owl_global *g, const char *kill, int len) {
     964  g_free(g->kill_buffer);
     965  g->kill_buffer = g_strndup(kill, len);
     966}
Note: See TracChangeset for help on using the changeset viewer.