Monday, January 20, 2003, 8:08:28 PM, you wrote:
> Stefan-
> True. I was trying to minimize the overhead of two function calls when
> it looked like one would do. It was a fleeting thought, and one that
> I've now quite happily abandoned.
> -Mark Wieder
> Using The Bat! v1.63 Beta/4 on Windows 2000 5.0 Build 2195 Service Pack 2
So far this is what I'm using for my GetString. I think this is
correct, and it appears to be working fine:
---
int GetString(char *src, char *dest, int size) {
if (dest==NULL || size<=0) return lstrlen(src);
if (size>lstrlen(src)) size = lstrlen(src);
if (size>0) {
lstrcpyn(dest,src,size+1); // (size+1) = (size) + (null character)
return size;
}
return 0;
}
Rob
________________________________________________
Current version is 1.62 | "Using TBDEV" information:
http://www.silverstones.com/thebat/TBUDLInfo.html