Changeset 79dcf4400f8b66d4ba7a389cc0c320576fe5764c

Show
Ignore:
Timestamp:
02/23/11 19:38:58 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1298489938 +0000
git-parent:

[5f14683bee8a05164f012b771390beeeb9c7f4c3]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1298489938 +0000
Message:

fixes #354

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/lua_noit.c

    r1774a2d r79dcf44  
    388388  bytes = lua_tolstring(L, 2, &nbytes); 
    389389  target = lua_tostring(L, 3); 
     390  if(!target) target = ""; 
    390391  port = lua_tointeger(L, 4); 
    391392 
     
    396397    rv = inet_pton(family, target, &a.sin6.sin6_addr); 
    397398    if(rv != 1) { 
    398       noitL(noit_stderr, "Cannot translate '%s' to IP\n", target); 
    399399      memset(&a, 0, sizeof(a)); 
    400400      lua_pushinteger(L, -1); 
     
    458458  e = *eptr; 
    459459  target = lua_tostring(L, 2); 
     460  if(!target) target = ""; 
    460461  port = lua_tointeger(L, 3); 
    461462 
     
    466467    rv = inet_pton(family, target, &a.sin6.sin6_addr); 
    467468    if(rv != 1) { 
    468       noitL(noit_stderr, "Cannot translate '%s' to IP\n", target); 
    469469      memset(&a, 0, sizeof(a)); 
    470470      lua_pushinteger(L, -1); 
     
    11311131  if(n > 0 && lua_isstring(L,1)) { 
    11321132    const char *fam = lua_tostring(L,1); 
     1133    if(!fam) fam = ""; 
    11331134    if(!strcmp(fam, "inet")) family = AF_INET; 
    11341135    else if(!strcmp(fam, "inet6")) family = AF_INET6;