Skip to content
Snippets Groups Projects
Commit 707216bd authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

be sure to use to good value

parent efa84bee
No related branches found
No related tags found
No related merge requests found
...@@ -24,19 +24,21 @@ ...@@ -24,19 +24,21 @@
#include <66/service.h> #include <66/service.h>
#include <66/parse.h> #include <66/parse.h>
int env_compute(stralloc *result, resolve_service_t *res) int env_compute(stralloc *result, resolve_service_t *res)
{ {
log_flow() ; log_flow() ;
int r ; int r ;
uint32_t conf = res->environ.env_overwrite ; uint32_t conf = res->environ.env_overwrite ;
char *version = res->sa.s + res->version ; size_t conflen = strlen(res->sa.s + res->environ.envdir), versionlen = strlen(res->sa.s + res->version), namelen = strlen(res->sa.s + res->name) ;
char *svconf = res->sa.s + res->environ.envdir ; char version[versionlen + 1] ;
char *name = res->sa.s + res->name ; char svconf[conflen + 1] ;
size_t svconf_len = strlen(svconf), version_len = strlen(version) ; char name[namelen + 1] ;
char src[svconf_len + 1 + version_len + 1] ; char src[conflen + 1 + versionlen + 1] ;
auto_strings(version, res->sa.s + res->version) ;
auto_strings(svconf, res->sa.s + res->environ.envdir) ;
auto_strings(name, res->sa.s + res->name) ;
auto_strings(src, svconf, "/", version) ; auto_strings(src, svconf, "/", version) ;
/** previous version, this is the current version before /** previous version, this is the current version before
...@@ -48,7 +50,6 @@ int env_compute(stralloc *result, resolve_service_t *res) ...@@ -48,7 +50,6 @@ int env_compute(stralloc *result, resolve_service_t *res)
/** store current configure file version before the switch /** store current configure file version before the switch
* of the symlink with the env_make_symlink() function */ * of the symlink with the env_make_symlink() function */
r = env_find_current_version(&pversion, svconf) ; r = env_find_current_version(&pversion, svconf) ;
if (r == -1) if (r == -1)
log_warnu_return(LOG_EXIT_ZERO, "find previous configuration file version") ; log_warnu_return(LOG_EXIT_ZERO, "find previous configuration file version") ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment