I definitely agree that buf needs to be at least 600. From what we can see, the memset probably also needs to use 600 (the size of buf). But since we only see parts of the code, there may be a reason that only part of buf is initialized.
Quote:
Originally Posted by porter
This would be appropriate if f[i] is initialized to point to a memory space. I would not replace the existing f[i] = "ARUN" code with this.
arunkumar_mca, it would probably take a lot of debugging to go beyond those suggestions. If you have a debugger, I suggest that you use it to trace through the code.
Dear all,
In my code,i am planning to use memset function to re-initialise an array before populating it everytime. Will using memset function be an overload to the program? (3 Replies)
Hi All,
we have an application that is written in 'C' programming to connects to various servers in the organization.
The bellow code establish a TCP connection to connect to the remote servers. the application works perfectly ok, but, after some time the entire process get's crashed and... (2 Replies)
Hi guys,
my tool works fine in gentoo, ubuntu now im trying to port it to windows but bzero/bcopy I read aren't working on windows and for better portability I should of use memset() so im trying to translate
bzero(buffer,256);in
printf("MAIL TO");
strcpy(buffer, rcp);
... (4 Replies)
Hey all,
Thanks for all the help you have given me. Two more things I am trying to figure out.
I need to issue a command..example
ps -ef | grep <process>
This would return about 10-15 running processes. I need to verify that there are x amount of processes running. What is... (7 Replies)
1.) I am to write scripts that will be phasetest folder in the home directory.
2.) The folder should have a set-up,phase and display files
I have written a small script which i used to check for the existing users and their password.
What I need help with:
I have a set of questions in a... (19 Replies)
1) The lpr and sort utilities accept input either from a file named on the command line or from standard input.
a)Name two other utilities that function in a similar manner.
b)Name a utility that accepts its input only from standard input.
2) Explain the following error message. What... (10 Replies)
Hello,
I would like to know how we can highlight/select a section of a file in vi and delete that section if we don't want to use the dd command to delete one line at at time. There is one where we don't want to delete the whole line , but up to a certain word. (2 Replies)
Hi,
memset call is failing on solaris for me. I wrote below code and that also fails. Any hints?
void *memset(void *dst, int c, size_t n)
{
if (n) {
char *d = dst;
do {
*d++ = c;
} while (--n);
}
return dst;
} (2 Replies)
Discussion started by: skyineyes
2 Replies
LEARN ABOUT XFREE86
memset
MEMSET(3) Linux Programmer's Manual MEMSET(3)NAME
memset - fill memory with a constant byte
SYNOPSIS
#include <string.h>
void *memset(void *s, int c, size_t n);
DESCRIPTION
The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c.
RETURN VALUE
The memset() function returns a pointer to the memory area s.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------+---------------+---------+
|Interface | Attribute | Value |
+----------+---------------+---------+
|memset() | Thread safety | MT-Safe |
+----------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
SEE ALSO bstring(3), bzero(3), swab(3), wmemset(3)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU 2017-03-13 MEMSET(3)