function snprint_asciistring
"RP, Giridhara" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <5FFF8E9361C5D84EBBAF70C1931CDDE30338C045@BTCMVEXC1-PRD.hq.netapp.com> |
Hello,
We are using snprint_asciistring to get the null terminated ascistring.
int
snprint_asciistring(char *buf, size_t buf_len,
const u_char * cp, size_t len)
This how I am calling (just an example),
#define MAX_BUFFER_SIZE 1024
char buf[MAX_BUFFER_SIZE];
size_t buf_len = MAX_BUFFER_SIZE;
const unsigned char input_buffer[]="myname\\unix"
size_t input_buf_len = strlen(input_buffrer);
snprint_asciistring(buf,buf_len,input_buffer,input_buf_len);
printf("buf printed is %s \n",buf);
The output is myname\\\\unix. Any reason why 2 extra '\' (escape) is
added to the buffer (buf). Please let me know the reason.
Also, is there any function which does not add these extra '\' ?
Thanks
Giri
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users