Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
5db1b0e9
Commit
5db1b0e9
authored
May 30, 2016
by
Hisham
Browse files
Remove extra checks made redundant by XAlloc.
parent
4674b4a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
StringUtils.c
View file @
5db1b0e9
...
...
@@ -69,13 +69,7 @@ char** String_split(const char* s, char sep, int* n) {
ctr
++
;
if
(
ctr
==
blocks
)
{
blocks
+=
rate
;
char
**
newOut
=
(
char
**
)
xRealloc
(
out
,
sizeof
(
char
*
)
*
blocks
);
if
(
newOut
)
{
out
=
newOut
;
}
else
{
blocks
-=
rate
;
break
;
}
out
=
(
char
**
)
xRealloc
(
out
,
sizeof
(
char
*
)
*
blocks
);
}
s
+=
size
+
1
;
}
...
...
@@ -86,10 +80,7 @@ char** String_split(const char* s, char sep, int* n) {
out
[
ctr
]
=
token
;
ctr
++
;
}
char
**
newOut
=
xRealloc
(
out
,
sizeof
(
char
*
)
*
(
ctr
+
1
));
if
(
newOut
)
{
out
=
newOut
;
}
out
=
xRealloc
(
out
,
sizeof
(
char
*
)
*
(
ctr
+
1
));
out
[
ctr
]
=
NULL
;
*
n
=
ctr
;
return
out
;
...
...
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