Logo Search packages:      
Sourcecode: likewise-open version File versions

static bool string_init ( char **  dest,
const char *  src 
) [static]

Set a string value, allocing the space for the string

Definition at line 995 of file util_str.c.

Referenced by string_set().

{
      size_t l;

      if (!src)
            src = "";

      l = strlen(src);

      if (l == 0) {
            *dest = CONST_DISCARD(char*, null_string);
      } else {
            (*dest) = SMB_STRDUP(src);
            if ((*dest) == NULL) {
                  DEBUG(0,("Out of memory in string_init\n"));
                  return false;
            }
      }
      return(true);
}


Generated by  Doxygen 1.6.0   Back to index