rem: return SOAP_EOM;
add: t = (char*)soap_malloc(soap, (n + 2) / 3 * 4 + 1); if (!t) { soap->error = SOAP_EOM; return NULL; } p = t;
context: soap_s2base64(struct soap *soap, const unsigned char *s, char *t, size_t n){ register size_t i;  register unsigned long m;  if (!t)    return SOAP_EOM;  t[0] = '\0';  if (!s)    return SOAP_OK;  for (; n > 2; n -= 3, s += 3)  { m = ((unsigned long)((unsigned char*)s)[0] << 16) | ((unsigned long)((unsigned char*)s)[1] << 8) | (unsigned long)((unsigned char*)s)[2];    for (i = 4; i > 0; m >>= 6)      t[--i] = soap_base64o[m & 0x3F];    t += 4;  }  t[0] = '\0';  if (n > 0)  { m = 0;    for (i = 0; i < n; i++)      m = (m << 8) | *s++;    for (; i < 3; i++)      m <<= 8;    for (i++; i > 0; m >>= 6)      t[--i] = soap_base64o[m & 0x3F];    for (i = 3; i > n; i--)      t[i] = '=';    t[4] = '\0';  }  return SOAP_OK;}