~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/conn_uds.cc

  • Committer: Brian Aker
  • Date: 2011-12-19 16:28:27 UTC
  • mto: (2478.1.1 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2478.
  • Revision ID: brian@tangent.org-20111219162827-bfwc9zzfk10omyil
Null safety fix for libdrizzle

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
const char *drizzle_con_uds(const drizzle_con_st *con)
46
46
{
 
47
  if (con == NULL)
 
48
  {
 
49
    return NULL;
 
50
  }
 
51
 
47
52
  if (con->socket_type == DRIZZLE_CON_SOCKET_UDS)
48
53
  {
49
54
    if (con->socket.uds.sockaddr.sun_path[0] != 0)
60
65
 
61
66
void drizzle_con_set_uds(drizzle_con_st *con, const char *uds)
62
67
{
 
68
  if (con == NULL)
 
69
  {
 
70
    return;
 
71
  }
 
72
 
63
73
  drizzle_con_reset_addrinfo(con);
64
74
 
65
75
  con->socket_type= DRIZZLE_CON_SOCKET_UDS;
66
76
 
67
77
  if (uds == NULL)
 
78
  {
68
79
    uds= "";
 
80
  }
69
81
 
70
82
  con->socket.uds.sockaddr.sun_family= AF_UNIX;
71
83
  strncpy(con->socket.uds.sockaddr.sun_path, uds,