mirror of
https://github.com/samba-team/samba.git
synced 2025-03-03 12:58:35 +03:00
s3: Tiny logic simplification
This commit is contained in:
parent
a3632f22ec
commit
6133ab6055
@ -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];
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user