10-20-2010
Well, vsprintf, not sprintf, and the code for vsprintf is not here. As I recall, vsprintf is very sensitive to proper usage! (I had a problem with one old Sun compiler inlining away call that generated the stack that had my vsprintf arguments!) Being a 64 bit compile adds another factor I am not sure of, but hopefully everyone is in agreement about the size of stack frames. You might add the includes and code changes to make the warnings go away.
Your sprintf says %d but you give a char* not an int.
10 More Discussions You Might Find Interesting
1. Solaris
********************************
Following is not the real issue. The issue is with popen.
Plz continue forward with the thread to get a better picture.
********************************
Hi,
I am working on a customised ftp application. In it we have used sprintf to store a UNIX command... (7 Replies)
Discussion started by: diganta
7 Replies
2. Programming
Hi,
Can someone help me to figure out whether this code is to write file to /tmp/TIMECLOCK directory or just to asign a variable with "/tmp/TIMECLOCK/name.log_copy.pid" as the string?
I am looking into an old C program and could not figure out where in the code that creates... (1 Reply)
Discussion started by: whatisthis
1 Replies
3. Shell Programming and Scripting
is there any sprintf function
in korn shell scripting,
or anything similar to sprintf? (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies
4. Programming
Hi
My requirement is to convert the following to C++
char buffer;
sprintf(buffer,"%s %-50s %6s %-6d %s\n",a.substr(0,5),a.substr(10,20))
Since the buffer is of varying length, i cannot hardcode the value as 90.
i would like to convert the buffer to string object so that it can receive any... (1 Reply)
Discussion started by: dhanamurthy
1 Replies
5. Shell Programming and Scripting
Hello,
In perl lang, I have create a string (@str) by sprintf but unfortunately when program printed it out, only I could saw a number like 1. Certainly printf doesn't problem. How I can convert a string that are result of sprintf to a common string format??!
Thanks in advance.
PLEASE HELP ME. (2 Replies)
Discussion started by: Zaxon
2 Replies
6. Shell Programming and Scripting
I would like to assign the output of printf to a variable in perl , it give me back a "1" instead of the time. How can I stuff the variable with what printf returns?
Here is my code:
#!/usr/bin/perl
$time = localtime(time);... (3 Replies)
Discussion started by: Dabheeruz
3 Replies
7. Shell Programming and Scripting
Hello again,
I don't know about regexp so I throw this question here:
How can I detect files where, for example:
sprintf (var1, "hello %s %s", sub1);
The problem here is that we have 2 %s and only a variable.
Or... the inverse:
sprintf (var1, "hello %s %s", sub1, sub2, sub3,...subn);
... (2 Replies)
Discussion started by: albertogarcia
2 Replies
8. Shell Programming and Scripting
Hi
I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it
The code is that:
{
if (NF==17){
print $0
}else{
fields=NF;
all=$0;
while... (2 Replies)
Discussion started by: fate
2 Replies
9. Programming
I need to right-pad with zeros a string by using (s)printf.
I looked up the manual and tried with
printf("%-19s", buffer);
which right-pad the string with spaces. So I tried
printf("%019s", buffer);
which left-pad the string with zeros. So I tried both
printf("%-019s", buffer);... (9 Replies)
Discussion started by: emitrax
9 Replies
10. UNIX for Dummies Questions & Answers
Hi,
Trying to join 2 files with awk (file1 has variable number of fields; file 2 has constant number of fields)
file1:
hook1|AA|BB|CC|DD
hook2|EE|FF
file2:
hook1|11|22
hook2|33|44
hook3|55|66
output:
hook1|11|22|AA|BB|CC|DD
hook2|33|44|EE|FF
hook3|55|66
What I tried so far:... (3 Replies)
Discussion started by: beca123456
3 Replies