git.ucc.asn.au
/
tpg
/
opendispense2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tidy up initialisation in doregex.c
[tpg/opendispense2.git]
/
src
/
common
/
doregex.c
diff --git
a/src/common/doregex.c
b/src/common/doregex.c
index
8ad9b39
..
f4242db
100644
(file)
--- a/
src/common/doregex.c
+++ b/
src/common/doregex.c
@@
-14,7
+14,7
@@
// === CODE ===
int RunRegex(regex_t *regex, const char *string, int nMatches, regmatch_t *matches, const char *errorMessage)
{
// === CODE ===
int RunRegex(regex_t *regex, const char *string, int nMatches, regmatch_t *matches, const char *errorMessage)
{
-
int ret
;
+
int ret = -1
;
ret = regexec(regex, string, nMatches, matches, 0);
if( ret == REG_NOMATCH ) {
ret = regexec(regex, string, nMatches, matches, 0);
if( ret == REG_NOMATCH ) {
@@
-34,7
+34,9
@@
int RunRegex(regex_t *regex, const char *string, int nMatches, regmatch_t *match
void CompileRegex(regex_t *regex, const char *pattern, int flags)
{
void CompileRegex(regex_t *regex, const char *pattern, int flags)
{
- int ret = regcomp(regex, pattern, flags);
+ int ret = -1;
+
+ ret = regcomp(regex, pattern, flags);
if( ret ) {
size_t len = regerror(ret, regex, NULL, 0);
char errorStr[len];
if( ret ) {
size_t len = regerror(ret, regex, NULL, 0);
char errorStr[len];
UCC
git Repository :: git.ucc.asn.au