void * pointer math in src/gpgme.c

Albert Chin gnupg-devel at mlists.thewrittenword.com
Mon Mar 10 21:47:43 CET 2014


gpgme_io_writen() in src/gpgme.c does math on a void function pointer
(buffer) which causes a problem for non-GNU compilers.

int
gpgme_io_writen (int fd, const void *buffer, size_t count)
{
  int ret = 0;
  TRACE_BEG2 (DEBUG_GLOBAL, "gpgme_io_writen", fd,
              "buffer=%p, count=%u", buffer, count);
  while (count)
    {
      ret = _gpgme_io_write (fd, buffer, count);
      if (ret < 0)
        break;
      buffer += ret;
      count -= ret;
      ret = 0;
    }
  return TRACE_SYSRES (ret);
}

-- 
albert chin (china at thewrittenword.com)



More information about the Gnupg-devel mailing list