X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=smbutil.c;h=78041ae969180f950f29cb6d5d682181079969da;hb=4bb8724c875163a426d7da7044b08582600367d1;hp=a26b349678bcb73e629177c10697135935de86af;hpb=8e4bfa7520c919ec2a7b00067c3348f0d1c73c8d;p=~andy%2Ffetchmail diff --git a/smbutil.c b/smbutil.c index a26b3496..78041ae9 100644 --- a/smbutil.c +++ b/smbutil.c @@ -26,7 +26,7 @@ char versionString[] ="libntlm version 0.21"; #define AddBytes(ptr, header, buf, count) \ { \ -if (buf && count) \ +if (buf != NULL && count != 0) \ { \ SSVAL(&ptr->header.len,0,count); \ SSVAL(&ptr->header.maxlen,0,count); \ @@ -44,23 +44,23 @@ else \ #define AddString(ptr, header, string) \ { \ -char *p = string; \ -int len = 0; \ -if (p) len = strlen(p); \ -AddBytes(ptr, header, ((unsigned char*)p), len); \ +char *p_ = string; \ +int len_ = 0; \ +if (p_) len_ = strlen(p_); \ +AddBytes(ptr, header, ((unsigned char*)p_), len_); \ } #define AddUnicodeString(ptr, header, string) \ { \ -char *p = string; \ -unsigned char *b = NULL; \ -int len = 0; \ -if (p) \ +char *p_ = string; \ +unsigned char *b_ = NULL; \ +int len_ = 0; \ +if (p_) \ { \ - len = strlen(p); \ - b = strToUnicode(p); \ + len_ = strlen(p_); \ + b_ = strToUnicode(p_); \ } \ -AddBytes(ptr, header, b, len*2); \ +AddBytes(ptr, header, b_, len_*2); \ } @@ -148,17 +148,17 @@ void dumpSmbNtlmAuthRequest(FILE *fp, tSmbNtlmAuthRequest *request) { fprintf(fp,"NTLM Request:\n"); fprintf(fp," Ident = %s\n",request->ident); - fprintf(fp," mType = %d\n",IVAL(&request->msgType,0)); + fprintf(fp," mType = %ld\n",(long int)IVAL(&request->msgType,0)); fprintf(fp," Flags = %08x\n",IVAL(&request->flags,0)); - fprintf(fp," User = %s\n",GetString(request,user)); - fprintf(fp," Domain = %s\n",GetString(request,domain)); + fprintf(fp," User = %s\n",(char *)GetString(request,user)); + fprintf(fp," Domain = %s\n",(char *)GetString(request,domain)); } void dumpSmbNtlmAuthChallenge(FILE *fp, tSmbNtlmAuthChallenge *challenge) { fprintf(fp,"NTLM Challenge:\n"); fprintf(fp," Ident = %s\n",challenge->ident); - fprintf(fp," mType = %d\n",IVAL(&challenge->msgType,0)); + fprintf(fp," mType = %ld\n",(long int)IVAL(&challenge->msgType,0)); fprintf(fp," Domain = %s\n",GetUnicodeString(challenge,uDomain)); fprintf(fp," Flags = %08x\n",IVAL(&challenge->flags,0)); fprintf(fp," Challenge = "); dumpRaw(fp, challenge->challengeData,8); @@ -168,7 +168,7 @@ void dumpSmbNtlmAuthResponse(FILE *fp, tSmbNtlmAuthResponse *response) { fprintf(fp,"NTLM Response:\n"); fprintf(fp," Ident = %s\n",response->ident); - fprintf(fp," mType = %d\n",IVAL(&response->msgType,0)); + fprintf(fp," mType = %ld\n",(long int)IVAL(&response->msgType,0)); fprintf(fp," LmResp = "); DumpBuffer(fp,response,lmResponse); fprintf(fp," NTResp = "); DumpBuffer(fp,response,ntResponse); fprintf(fp," Domain = %s\n",GetUnicodeString(response,uDomain));