[BACK]Return to oxf.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_toolkit

Diff for /OpenXM/src/ox_toolkit/oxf.c between version 1.16 and 1.17

version 1.16, 2003/05/29 15:50:49 version 1.17, 2003/06/02 10:25:57
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM: OpenXM/src/ox_toolkit/oxf.c,v 1.15 2003/03/23 20:17:35 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_toolkit/oxf.c,v 1.16 2003/05/29 15:50:49 ohara Exp $ */
   
 /*  /*
    This module includes functions for sending/receiveng CMO's.     This module includes functions for sending/receiveng CMO's.
Line 36  static int receive_int32_nbo(OXFILE *oxfp);
Line 36  static int receive_int32_nbo(OXFILE *oxfp);
 int oxf_setbuffer(OXFILE *oxfp, char *buf, int size)  int oxf_setbuffer(OXFILE *oxfp, char *buf, int size)
 {  {
     if (buf == NULL && size > 0) {      if (buf == NULL && size > 0) {
         buf = malloc(size);          buf = MALLOC(size);
     }      }
     if (oxfp->wbuf != NULL) {      if (oxfp->wbuf != NULL) {
         oxf_flush(oxfp);          oxf_flush(oxfp);
Line 110  static int receive_int32_lbo(OXFILE *oxfp)
Line 110  static int receive_int32_lbo(OXFILE *oxfp)
 */  */
 OXFILE *oxf_open(int fd)  OXFILE *oxf_open(int fd)
 {  {
     OXFILE *oxfp = (OXFILE *)malloc(sizeof(OXFILE));      OXFILE *oxfp = (OXFILE *)MALLOC(sizeof(OXFILE));
     oxfp = (OXFILE *)malloc(sizeof(OXFILE));      oxfp = (OXFILE *)MALLOC(sizeof(OXFILE));
     oxfp->fd = fd;      oxfp->fd = fd;
     oxfp->send_int32    = send_int32_nbo;      oxfp->send_int32    = send_int32_nbo;
     oxfp->receive_int32 = receive_int32_nbo;      oxfp->receive_int32 = receive_int32_nbo;
Line 238  char *generate_otp()
Line 238  char *generate_otp()
 int oxf_confirm_client(OXFILE *oxfp, char *passwd)  int oxf_confirm_client(OXFILE *oxfp, char *passwd)
 {  {
     int len = strlen(passwd)+1;      int len = strlen(passwd)+1;
     char *buf = alloca(len);      char *buf = ALLOCA(len);
   
     oxf_read(buf, 1, len, oxfp);      oxf_read(buf, 1, len, oxfp);
     return !strcmp(passwd, buf);      return !strcmp(passwd, buf);
Line 274  char *which(char *exe, const char *env)
Line 274  char *which(char *exe, const char *env)
     char *tok;      char *tok;
     char *path;      char *path;
     char delim[] = ":";      char delim[] = ":";
     char *e = alloca(strlen(env)+1);      char *e = ALLOCA(strlen(env)+1);
     strcpy(e, env);      strcpy(e, env);
     tok = strtok(e, delim);      tok = strtok(e, delim);
     while (tok != NULL) {      while (tok != NULL) {
         path = malloc(strlen(tok)+strlen(exe)+2);          path = MALLOC(strlen(tok)+strlen(exe)+2);
         sprintf(path, "%s/%s", tok, exe);          sprintf(path, "%s/%s", tok, exe);
         if (access(path, X_OK&R_OK) == 0) {          if (access(path, X_OK&R_OK) == 0) {
             return path;              return path;
         }          }
         free(path);          FREE(path);
         tok = strtok(NULL, delim);          tok = strtok(NULL, delim);
     }      }
     return NULL;      return NULL;
Line 348  static char *pipe_read_string()
Line 348  static char *pipe_read_string()
         char *s;          char *s;
         read(0, &len, sizeof(int));          read(0, &len, sizeof(int));
         len = ntohl(len)+1;          len = ntohl(len)+1;
         s = malloc(len);          s = MALLOC(len);
         read(0, s, len);          read(0, s, len);
         return s;          return s;
 }  }

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>