Share

The mimedecode library

Tracker: Bugs

5 Base64 decoder problem (with fix) - ID: 1649402
Last Update: Tracker Item Submitted ( joelthedrummer )

In parser.cpp, line 16, the following code:

unsigned int pos = encoding.find(c);
if (pos >= 0) {
...
}

should be changed to:

int pos = encoding.find(c);
if (pos != std::string::npos) {
...
}

With the way the code was before, the condition in the if statement (pos >=
0) would always be true because pos was defined as an unsigned integer
(always positive). Also, using std::string::npos is probably more standard
way of doing it (perhaps).

I ran into this problem because the base64 encoded attachments were not
being decoded properly until I fixed this.

-Joel

Environment:
Windows XP, Microsfot Visual Studio 2005


Joel S. ( joelthedrummer ) - 2007-02-01 05:35

5

Open

None

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.