Changeset 5bc0f68


Ignore:
Timestamp:
Dec 23, 2007, 9:19:08 PM (17 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
28ee32b
Parents:
93ee554 (diff), 89f5338 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merged revisions 777-778 via svnmerge from 
file:///afs/sipb.mit.edu/project/barnowl/src/svn/trunk

........
  r778 | asedeno | 2007-12-23 21:18:36 -0500 (Sun, 23 Dec 2007) | 1 line
  
  Moving owl_get_datadir to util.c so make test'' works again.
........
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r93ee554 r5bc0f68  
    6565owl_global g;
    6666
    67 char * owl_get_datadir() {
    68     char * datadir = getenv("BARNOWL_DATA_DIR");
    69     if(datadir != NULL)
    70         return strchr(datadir, '=') + 1;
    71     return DATADIR;
    72 }
    73 
    7467int main(int argc, char **argv, char **env)
    7568{
  • util.c

    r93ee554 r5bc0f68  
    776776}
    777777
     778char * owl_get_datadir() {
     779    char * datadir = getenv("BARNOWL_DATA_DIR");
     780    if(datadir != NULL)
     781        return strchr(datadir, '=') + 1;
     782    return DATADIR;
     783}
     784
    778785/**************************************************************************/
    779786/************************* REGRESSION TESTS *******************************/
  • aim.c

    r9854278 r34509d5  
    948948 
    949949  if (modname) {
    950     if (!(filename = malloc(strlen(priv->aimbinarypath)+1+strlen(modname)+4+1))) {
     950    if (!(filename = owl_malloc(strlen(priv->aimbinarypath)+1+strlen(modname)+4+1))) {
    951951      /* perror("memrequest: malloc"); */
    952952      return -1;
     
    954954    sprintf(filename, "%s/%s.ocm", priv->aimbinarypath, modname);
    955955  } else {
    956     if (!(filename = malloc(strlen(priv->aimbinarypath)+1+strlen(defaultmod)+1))) {
     956    if (!(filename = owl_malloc(strlen(priv->aimbinarypath)+1+strlen(defaultmod)+1))) {
    957957      /* perror("memrequest: malloc"); */
    958958      return -1;
     
    964964    if (!modname) {
    965965      /* perror("memrequest: stat"); */
    966       free(filename);
     966      owl_free(filename);
    967967      return -1;
    968968    }
     
    986986    int i;
    987987   
    988     free(filename); /* not needed */
     988    owl_free(filename); /* not needed */
    989989    owl_function_error("getaimdata memrequest: recieved invalid request for 0x%08lx bytes at 0x%08lx (file %s)\n", len, offset, modname);
    990990    i = 8;
     
    993993    }
    994994   
    995     if (!(buf = malloc(i))) {
     995    if (!(buf = owl_malloc(i))) {
    996996      return -1;
    997997    }
     
    10171017    *buflenret = i;
    10181018  } else {
    1019     if (!(buf = malloc(len))) {
    1020       free(filename);
     1019    if (!(buf = owl_malloc(len))) {
     1020      owl_free(filename);
    10211021      return -1;
    10221022    }
     
    10241024    if (!(f = fopen(filename, "r"))) {
    10251025      /* perror("memrequest: fopen"); */
    1026       free(filename);
    1027       free(buf);
     1026      owl_free(filename);
     1027      owl_free(buf);
    10281028      return -1;
    10291029    }
    10301030   
    1031     free(filename);
     1031    owl_free(filename);
    10321032   
    10331033    if (fseek(f, offset, SEEK_SET) == -1) {
    10341034      /* perror("memrequest: fseek"); */
    10351035      fclose(f);
    1036       free(buf);
     1036      owl_free(buf);
    10371037      return -1;
    10381038    }
     
    10411041      /* perror("memrequest: fread"); */
    10421042      fclose(f);
    1043       free(buf);
     1043      owl_free(buf);
    10441044      return -1;
    10451045    }
     
    10761076  if (priv->aimbinarypath && (getaimdata(sess, &buf, &buflen, offset, len, modname) == 0)) {
    10771077    aim_sendmemblock(sess, fr->conn, offset, buflen, buf, AIM_SENDMEMBLOCK_FLAG_ISREQUEST);
    1078     free(buf);
     1078    owl_free(buf);
    10791079  } else {
    10801080    owl_function_debugmsg("faimtest_memrequest: unable to use AIM binary (\"%s/%s\"), sending defaults...\n", priv->aimbinarypath, modname);
     
    13421342      int z;
    13431343     
    1344       newbuf = malloc(i+1);
     1344      newbuf = owl_malloc(i+1);
    13451345      for (z = 0; z < i; z++)
    13461346        newbuf[z] = (z % 10)+0x30;
    13471347      newbuf[i] = '\0';
    13481348      /* aim_send_im(sess, userinfo->sn, AIM_IMFLAGS_ACK | AIM_IMFLAGS_AWAY, newbuf); */
    1349       free(newbuf);
     1349      owl_free(newbuf);
    13501350    }
    13511351  } else if (strstr(tmpstr, "seticqstatus")) {
  • cmd.c

    r6922edd r34509d5  
    7474  owl_cmd *cmd;
    7575
    76   tmpbuff=strdup(cmdbuff);
     76  tmpbuff=owl_strdup(cmdbuff);
    7777  argv=owl_parseline(tmpbuff, &argc);
    7878  if (argc < 0) {
  • configure.in

    r18e28a4 r93ee554  
    1212fi
    1313
     14dnl m4_include(/usr/share/aclocal/pkg.m4)
     15m4_include(pkg.m4)
    1416
    1517dnl Check for Athena
     
    109111LDFLAGS=${LDFLAGS}\ ${FOO}
    110112
     113dnl Add CFLAGS and LDFLAGS for glib-2.0
     114PKG_CHECK_MODULES(GLIB,glib-2.0)
     115
     116echo Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}
     117CFLAGS=${CFLAGS}\ ${GLIB_CFLAGS}
     118echo Adding glib-2.0 LDFLAGS ${GLIB_LIBS}
     119LDFLAGS=${LDFLAGS}\ ${GLIB_LIBS}
     120
     121
    111122dnl Checks for typedefs, structures, and compiler characteristics.
    112123
  • functions.c

    r3939268 r93ee554  
    30233023  char *quoted;
    30243024
    3025   buff=malloc(strlen(class)+strlen(inst)+strlen(recip)+100);
     3025  buff=owl_malloc(strlen(class)+strlen(inst)+strlen(recip)+100);
    30263026  strcpy(buff, "class");
    30273027  if (!strcmp(class, "*")) {
     
    33273327          if (ret==0) {
    33283328            for (x=0; x<numlocs; x++) {
    3329               line=malloc(strlen(location[x].host)+strlen(location[x].time)+strlen(location[x].tty)+100);
     3329              line=owl_malloc(strlen(location[x].host)+strlen(location[x].time)+strlen(location[x].tty)+100);
    33303330              tmp=short_zuser(user);
    33313331              sprintf(line, "  %-10.10s %-24.24s %-12.12s  %20.20s\n",
     
    34333433          _exit(127);
    34343434        }
    3435         parsed=realloc(parsed, sizeof(*parsed) * (myargc+1));
     3435        parsed=owl_realloc(parsed, sizeof(*parsed) * (myargc+1));
    34363436        parsed[myargc] = NULL;
    34373437       
  • global.c

    rad15610 r93ee554  
    545545    len+=strlen(argv[i])+5;
    546546  }
    547   g->startupargs=malloc(len+5);
     547  g->startupargs=owl_malloc(len+5);
    548548
    549549  strcpy(g->startupargs, "");
  • message.c

    r6711361 r93ee554  
    493493{
    494494  if(m->zwriteline) owl_free(m->zwriteline);
    495   m->zwriteline=strdup(line);
     495  m->zwriteline=owl_strdup(line);
    496496}
    497497
     
    890890  }
    891891
    892   m->zwriteline=strdup("");
     892  m->zwriteline=owl_strdup("");
    893893
    894894  /* save the hostname */
     
    972972  }
    973973
    974   m->zwriteline=strdup("");
     974  m->zwriteline=owl_strdup("");
    975975
    976976  owl_message_set_body(m, "<uninitialized>");
  • owl.h

    r18e28a4 r93ee554  
    5353#include <libfaim/aim.h>
    5454#include "config.h"
     55#include "glib.h"
    5556#ifdef HAVE_LIBZEPHYR
    5657#include <zephyr/zephyr.h>
  • text.c

    r72db971 r34509d5  
    327327  tolen  = strlen(to);
    328328  fromlen  = strlen(from);
    329   out = malloc(outlen);
     329  out = owl_malloc(outlen);
    330330
    331331  while (in[inpos]) {
  • zcrypt.c

    r9ceee9d r34509d5  
    385385
    386386/* Build a space-separated string from argv from elements between start  *
    387  * and end - 1.  malloc()'s the returned string. */
     387 * and end - 1.  owl_malloc()'s the returned string. */
    388388char *BuildArgString(char **argv, int start, int end) {
    389389  int len = 1;
     
    397397
    398398  /* Allocate memory */
    399   result = (char *)malloc(len);
     399  result = (char *)owl_malloc(len);
    400400  if (result) {
    401401    /* Build the string */
     
    482482      /* Prepare result to be returned */
    483483      char *temp = keyfile;
    484       keyfile = (char *)malloc(strlen(temp) + 1);
     484      keyfile = (char *)owl_malloc(strlen(temp) + 1);
    485485      if (keyfile) {
    486486        strcpy(keyfile, temp);
     
    611611      }
    612612      use_buffer = TRUE;
    613       if ((inptr = inbuff = (char *)malloc(MAX_RESULT)) == NULL) {
     613      if ((inptr = inbuff = (char *)owl_malloc(MAX_RESULT)) == NULL) {
    614614        printf("Memory allocation error\n");
    615615        return FALSE;
     
    639639      printf("Could not run zwrite\n");
    640640      if (freein && inbuff) {
    641         free(inbuff);
     641        owl_free(inbuff);
    642642      }
    643643      return(FALSE);
     
    685685
    686686  /* Free the input buffer, if necessary */
    687   if (freein && inbuff) free(inbuff);
     687  if (freein && inbuff) owl_free(inbuff);
    688688
    689689  return(!error);
  • zwrite.c

    r1fe100c r93ee554  
    9595      z->message=owl_strdup("");
    9696      while (myargc) {
    97         z->message=realloc(z->message, strlen(z->message)+strlen(myargv[0])+5);
     97        z->message=owl_realloc(z->message, strlen(z->message)+strlen(myargv[0])+5);
    9898        strcat(z->message, myargv[0]);
    9999        strcat(z->message, " ");
     
    113113    } else {
    114114      /* anything unattached is a recipient */
    115       owl_list_append_element(&(z->recips), strdup(myargv[0]));
     115      owl_list_append_element(&(z->recips), owl_strdup(myargv[0]));
    116116      myargv++;
    117117      myargc--;
     
    177177      z->zsig=owl_strdup(zsigzvar);
    178178    } else if (((pw=getpwuid(getuid()))!=NULL) && (pw->pw_gecos)) {
    179       z->zsig=strdup(pw->pw_gecos);
     179      z->zsig=owl_strdup(pw->pw_gecos);
    180180      ptr=strchr(z->zsig, ',');
    181181      if (ptr) {
Note: See TracChangeset for help on using the changeset viewer.