Changeset 18aace8 in tol


Ignore:
Timestamp:
Oct 18, 2010, 10:59:14 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
42759af
Parents:
52d34ff
Message:

skipping line breaks in base64_decode

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2586 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/bbasic/txtalgeb.cpp

    r52d34ff r18aace8  
    18621862
    18631863//--------------------------------------------------------------------
    1864 int base64_decode(BArray<unsigned char>& binary, std::string const& encoded_string)
     1864int base64_decode(
     1865  BArray<unsigned char>& binary,
     1866  std::string const& encoded_string)
    18651867//--------------------------------------------------------------------
    18661868{
    … …  
    18731875  binary.AllocBuffer(bin_len);
    18741876  binary.ReallocBuffer(0);
    1875 
    1876   while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
    1877     char_array_4[i++] = encoded_string[in_]; in_++;
     1877  unsigned char ch;
     1878  while (in_len-- && ( (ch=encoded_string[in_]) != '='))
     1879  {
     1880    if(!is_base64(ch))
     1881    {
     1882      if(ch=='\n') { in_++; continue; }
     1883      else         { break; }
     1884    }
     1885    char_array_4[i++] = ch; in_++;
    18781886    if (i ==4) {
    18791887      for (i = 0; i <4; i++)
Note: See TracChangeset for help on using the changeset viewer.