data not writing to struct

Hello, I have an issue with a structure that is being used to store an encrypted string value. Apparently, for some unknown reason, the code is not storing the new value to the string object

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
struct PGDStore {

   string encEXP;
   void add(const F32 add, string key);

}

void PGDStore::add(const F32 add, string key) {
   
   std::string exp, out;
   std::string bleh = encEXP;

   if(bleh.compare("0") != 0) {
      pgdCry.AESDecrypt(key, bleh, exp, 1000);
   }
   else {
      exp = "0";
   }
   const F32 final = dAtof(exp.c_str()) + add;

   char buff[256];
   dSprintf(buff, sizeof(buff), "%f", final);  
   pgdCry.AESEncrypt(key, string(buff), out, 1000);
   encEXP.assign(out);

}


AESEncrypt/Decrypt uses these vars

AESEncrypt(std::string key, std::string input, std::string &output, unsigned int PBKDFIter);
AESDecrypt(std::string key, std::string input, std::string &output, unsigned int PBKDFIter);

The contents of the out variable when used in a debug statement is correct, however, the content of the struct variable remains blank.

I am using:
 
extern PGDStore *store;


To access the structure from all of my cpp files that use it, and main initializes the central object via a PGDStore::PGDStore() constructor which sets the object to be known by all files.
Last edited on
Topic archived. No new replies allowed.