Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3bf126ed
Commit
3bf126ed
authored
Jan 06, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NdbRecAttr.cpp:
improved printout routine ndb/src/ndbapi/NdbRecAttr.cpp: improved printout routine
parent
308a062a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
ndb/src/ndbapi/NdbRecAttr.cpp
ndb/src/ndbapi/NdbRecAttr.cpp
+7
-18
No files found.
ndb/src/ndbapi/NdbRecAttr.cpp
View file @
3bf126ed
...
@@ -141,40 +141,29 @@ static void
...
@@ -141,40 +141,29 @@ static void
ndbrecattr_print_string
(
NdbOut
&
out
,
const
char
*
type
,
ndbrecattr_print_string
(
NdbOut
&
out
,
const
char
*
type
,
const
char
*
ref
,
unsigned
sz
)
const
char
*
ref
,
unsigned
sz
)
{
{
int
i
;
int
i
,
len
,
printable
=
1
;
// trailing zeroes are not printed
// trailing zeroes are not printed
for
(
i
=
sz
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
sz
-
1
;
i
>=
0
;
i
--
)
if
(
ref
[
i
]
==
0
)
sz
--
;
if
(
ref
[
i
]
==
0
)
sz
--
;
else
break
;
else
break
;
if
(
sz
==
0
)
return
;
// empty
if
(
sz
==
0
)
return
;
// empty
char
*
str
=
(
char
*
)
malloc
(
sz
+
1
);
for
(
len
=
0
;
len
<
(
int
)
sz
&&
ref
[
i
]
!=
0
;
len
++
)
memcpy
(
str
,
ref
,
sz
);
if
(
printable
&&
!
isprint
((
int
)
ref
[
i
]))
str
[
sz
]
=
0
;
// null terminate
int
len
=
strlen
(
str
);
int
printable
=
1
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
str
[
i
]
<
32
)
{
printable
=
0
;
printable
=
0
;
break
;
}
}
if
(
printable
)
if
(
printable
)
out
.
print
(
"%.*s"
,
len
,
str
);
out
.
print
(
"%.*s"
,
len
,
ref
);
else
else
{
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
out
.
print
(
"%02X"
,
(
int
)
str
[
i
]);
out
.
print
(
"%02X"
,
(
int
)
ref
[
i
]);
}
free
(
str
);
if
(
len
!=
(
int
)
sz
)
if
(
len
!=
(
int
)
sz
)
{
{
out
.
print
(
"["
);
out
.
print
(
"["
);
for
(
i
=
len
+
1
;
ref
[
i
]
!=
0
;
i
++
)
for
(
i
=
len
+
1
;
ref
[
i
]
!=
0
;
i
++
)
out
.
print
(
"%u]"
,
len
-
i
);
out
.
print
(
"%u]"
,
len
-
i
);
assert
(
sz
>
i
);
assert
(
(
int
)
sz
>
i
);
ndbrecattr_print_string
(
out
,
type
,
ref
+
i
,
sz
-
i
);
ndbrecattr_print_string
(
out
,
type
,
ref
+
i
,
sz
-
i
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment