Re: strcpy, strtok and strcat problem...



Dang <dangamit@xxxxxxxxx> wrote:


Hi, if this is the actual code then I can see some issue. In function
"m_raliasrecord_init" you have taken two char pointers target_path_cpy,
target_path_cpy2 and you are directly doing a strcpy. Who is allocation
memory for them?

fine thanks ))

char *pieces[32];

pieces being an array of char, i suppose i need also to malloc each
element of this array ?
--
une bévue
.



Relevant Pages

  • Re: String Concatenation Using Pointers No strcat()
    ... The signature for strcpy() is: ... pointer to the function. ... You can't pass an array into any function. ... dest = malloc+1; ...
    (comp.lang.c)
  • Re: memcpy/memmove
    ... and sizeof will automatically be the sizeof a ... >> pointer. ... The point is that strcpy does not receive sufficient ... If the array definition is not in scope, ...
    (comp.lang.c)
  • Re: Bounds checked string library
    ... A good compiler will have its own way to check them during ... There is no way to write the strcpy function without ... When you read 4 bytes from a file into a 12-byte array, ... Who said I was using fread? ...
    (comp.lang.c)
  • Re: Strings and arrays
    ... words and save them into an array. ... The plan might have been to point to each word returned by strtok. ... In both cases the initial call to strcpy seems wrong. ... I would copy the string counting words as I go. ...
    (comp.lang.c)
  • Re: Write to dynamic two dimension array outside the range without Segmentation fault
    ... strcpy doesn't nul terminate, so your call to printf will fault. ... is a pointer to an array of three char. ...
    (comp.lang.c)