Skip to content

Commit

Permalink
Fix compiler warning about variables beign used unintialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Casanova authored and Jaime Casanova committed Mar 8, 2011
1 parent a4f4899 commit 6404ba2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ parse_config(const char* config_file, t_configuration_options* options)
strncpy (options->logfacility, value, MAXLEN);
else if (strcmp(name, "failover") == 0)
{
char *failoverstr;
char failoverstr[MAXLEN];
strncpy(failoverstr, value, MAXLEN);

if (strcmp(failoverstr, "manual"))
Expand Down
12 changes: 6 additions & 6 deletions sql/repmgr_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ repmgr_set_standby_location(char *locationstr)
Datum
repmgr_get_last_standby_location(PG_FUNCTION_ARGS)
{
char *location;
char location[MAXFNAMELEN];

/* Safety check... */
if (!shared_state)
PG_RETURN_NULL();
/* Safety check... */
if (!shared_state)
PG_RETURN_NULL();

LWLockAcquire(shared_state->lock, LW_SHARED);
LWLockAcquire(shared_state->lock, LW_SHARED);
strncpy(location, shared_state->location, MAXFNAMELEN);
LWLockRelease(shared_state->lock);
LWLockRelease(shared_state->lock);

PG_RETURN_TEXT_P(cstring_to_text(location));
}
Expand Down

0 comments on commit 6404ba2

Please sign in to comment.