1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-02 08:58:33 +03:00

s3: Tiny logic simplification

This commit is contained in:
Volker Lendecke 2009-11-12 20:44:37 +01:00
parent a3632f22ec
commit 6133ab6055

View File

@ -27,20 +27,21 @@
static const char *fix_char_ptr(unsigned int datap, unsigned int converter,
char *rdata, int rdrcnt)
{
unsigned int offset;
if (datap == 0) {
/* turn NULL pointers into zero length strings */
return "";
} else {
unsigned int offset = datap - converter;
if (offset >= rdrcnt) {
DEBUG(1,("bad char ptr: datap=%u, converter=%u rdrcnt=%d>",
datap, converter, rdrcnt));
return "<ERROR>";
} else {
return &rdata[offset];
}
}
offset = datap - converter;
if (offset >= rdrcnt) {
DEBUG(1,("bad char ptr: datap=%u, converter=%u rdrcnt=%d>",
datap, converter, rdrcnt));
return "<ERROR>";
}
return &rdata[offset];
}
/****************************************************************************