summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-12 20:44:37 +0100
committerVolker Lendecke <vl@samba.org>2009-11-14 11:03:28 +0100
commit6133ab6055f68a11380d384c1d871774139035ea (patch)
treef14233565d93284cb03b5c88ac3c143de9caa9ca /source3/libsmb
parenta3632f22ec228f4e74e819305bb4c1c5aeca293c (diff)
downloadsamba-6133ab6055f68a11380d384c1d871774139035ea.tar.gz
samba-6133ab6055f68a11380d384c1d871774139035ea.tar.bz2
samba-6133ab6055f68a11380d384c1d871774139035ea.zip
s3: Tiny logic simplification
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliprint.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/libsmb/cliprint.c b/source3/libsmb/cliprint.c
index e78930c1d5..723ae02623 100644
--- a/source3/libsmb/cliprint.c
+++ b/source3/libsmb/cliprint.c
@@ -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];
}
/****************************************************************************