Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
340d21a1
Commit
340d21a1
authored
15 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
iniGet/ReadNamedStringList() now return NULL if there are no keys in the
specified section or the section does not exist.
parent
40de6265
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/ini_file.c
+6
-14
6 additions, 14 deletions
src/xpdev/ini_file.c
with
6 additions
and
14 deletions
src/xpdev/ini_file.c
+
6
−
14
View file @
340d21a1
...
...
@@ -998,14 +998,9 @@ iniReadNamedStringList(FILE* fp, const char* section)
char
*
value
;
char
str
[
INI_MAX_LINE_LEN
];
ulong
items
=
0
;
named_string_t
**
lp
;
named_string_t
**
lp
=
NULL
;
named_string_t
**
np
;
if
((
lp
=
(
named_string_t
**
)
malloc
(
sizeof
(
named_string_t
*
)))
==
NULL
)
return
(
NULL
);
*
lp
=
NULL
;
if
(
fp
==
NULL
)
return
(
lp
);
...
...
@@ -1035,7 +1030,8 @@ iniReadNamedStringList(FILE* fp, const char* section)
items
++
;
}
lp
[
items
]
=
NULL
;
/* terminate list */
if
(
items
)
lp
[
items
]
=
NULL
;
/* terminate list */
return
(
lp
);
}
...
...
@@ -1047,14 +1043,9 @@ iniGetNamedStringList(str_list_t list, const char* section)
char
*
value
;
char
str
[
INI_MAX_LINE_LEN
];
ulong
i
,
items
=
0
;
named_string_t
**
lp
;
named_string_t
**
lp
=
NULL
;
named_string_t
**
np
;
if
((
lp
=
(
named_string_t
**
)
malloc
(
sizeof
(
named_string_t
*
)))
==
NULL
)
return
(
NULL
);
*
lp
=
NULL
;
if
(
list
==
NULL
)
return
(
lp
);
...
...
@@ -1078,7 +1069,8 @@ iniGetNamedStringList(str_list_t list, const char* section)
items
++
;
}
lp
[
items
]
=
NULL
;
/* terminate list */
if
(
items
)
lp
[
items
]
=
NULL
;
/* terminate list */
return
(
lp
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment