Back to index

php5  5.3.10
Functions
fpm_trace.c File Reference
#include "fpm_config.h"
#include <sys/types.h>
#include "fpm_trace.h"

Go to the source code of this file.

Functions

int fpm_trace_get_strz (char *buf, size_t sz, long addr)

Function Documentation

int fpm_trace_get_strz ( char *  buf,
size_t  sz,
long  addr 
)

Definition at line 11 of file fpm_trace.c.

{
       int i;
       long l;
       char *lc = (char *) &l;

       if (0 > fpm_trace_get_long(addr, &l)) {
              return -1;
       }

       i = l % SIZEOF_LONG;
       l -= i;
       for (addr = l; ; addr += SIZEOF_LONG) {
              if (0 > fpm_trace_get_long(addr, &l)) {
                     return -1;
              }
              for ( ; i < SIZEOF_LONG; i++) {
                     --sz;
                     if (sz && lc[i]) {
                            *buf++ = lc[i];
                            continue;
                     }
                     *buf = '\0';
                     return 0;
              }
              i = 0;
       }
}

Here is the call graph for this function: