TA的每日心情 | 衰 2016-12-30 10:59 |
---|
签到天数: 6 天 连续签到: 1 天 [LV.2]测试排长
|
给你一个例子:
char *UserBuf, *StrToLog;
int LenOfUserBuf;
lrs_get_static_buffer("socket1", "buf10", 0, -1, NULL);
UserBuf = lrs_get_user_buffer("socket1");
LenOfUserBuf = lrs_get_user_buffer_size("socket1");
StrToLog = (char*)malloc(LenOfUserBuf + 1);
/* Copy user buffer and skip two unprintable characters at the beginning */
strncpy(StrToLog, UserBuf+2, LenOfUserBuf-2);
lr_output_message("UserBuf = \"%s\"", StrToLog);
lr_output_message("The buffer size = \"%d\"", LenOfUserBuf);
The output generated by the above code, as seen in the VuGen Execution log is:
Message from run.c(52): UserBuf = "X-AUTHENTICATION-1"
Message from run.c(52): The buffer size = 20 |
|