diff options
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/configuration.cc | 13 | ||||
-rw-r--r-- | apt-pkg/contrib/configuration.h | 1 | ||||
-rw-r--r-- | apt-pkg/contrib/sha1.cc | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index cc7093fe2..942ea9fbc 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -318,6 +318,19 @@ void Configuration::CndSet(const char *Name,const string &Value) Itm->Value = Value; } /*}}}*/ +// Configuration::Set - Set an integer value /*{{{*/ +// --------------------------------------------------------------------- +/* */ +void Configuration::CndSet(const char *Name,int const Value) +{ + Item *Itm = Lookup(Name,true); + if (Itm == 0 || Itm->Value.empty() == false) + return; + char S[300]; + snprintf(S,sizeof(S),"%i",Value); + Itm->Value = S; +} + /*}}}*/ // Configuration::Set - Set a value /*{{{*/ // --------------------------------------------------------------------- /* */ diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 71e5a0e47..2844ec097 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -82,6 +82,7 @@ class Configuration inline void Set(const string &Name,const string &Value) {Set(Name.c_str(),Value);}; void CndSet(const char *Name,const string &Value); + void CndSet(const char *Name,const int Value); void Set(const char *Name,const string &Value); void Set(const char *Name,const int &Value); diff --git a/apt-pkg/contrib/sha1.cc b/apt-pkg/contrib/sha1.cc index eae52d52f..abc2aaf9f 100644 --- a/apt-pkg/contrib/sha1.cc +++ b/apt-pkg/contrib/sha1.cc @@ -74,10 +74,9 @@ static void SHA1Transform(uint32_t state[5],uint8_t const buffer[64]) uint32_t l[16]; } CHAR64LONG16; - CHAR64LONG16 *block; + CHAR64LONG16 workspace, *block; - uint8_t workspace[64]; - block = (CHAR64LONG16 *)workspace; + block = &workspace; memcpy(block,buffer,sizeof(workspace)); /* Copy context->state[] to working vars */ |