Back to index

courier  0.68.2
Functions
rfc1035gettxt.c File Reference
#include "rfc1035.h"
#include <string.h>

Go to the source code of this file.

Functions

int rfc1035_rr_gettxt (struct rfc1035_rr *p, int startpos, char buf[256])

Function Documentation

int rfc1035_rr_gettxt ( struct rfc1035_rr p,
int  startpos,
char  buf[256] 
)

Definition at line 10 of file rfc1035gettxt.c.

{
unsigned l;

       if (startpos < 0 || (unsigned)startpos >= p->rdlength ||
              p->rdlength - (unsigned)startpos <=
                     (l=(unsigned)(unsigned char)p->rdata[startpos]))
       {
              buf[0]=0;
              return (-1);
       }

       ++startpos;

       memcpy(buf, p->rdata + startpos, l);
       buf[l]=0;
       startpos += l;
       if (startpos >= p->rdlength)
              startpos= -1;
       return (startpos);
}

Here is the caller graph for this function: