Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

strncpy() vs strncat()

Name: Anonymous 2008-07-05 17:26

Hey /prog/, I've just googled this and it returned a bunch of faggots complaining about buffer overflows.

My question is, as both functions seem to do the same thing, which one would you use?

The man page doesn't leave this clear either, it just says that strcpy zerofills the buffer.

Name: Anonymous 2008-07-05 17:28

You should implement string handling functionality in a language that supports strings.

Name: OP 2008-07-05 17:42

>>2
I was expecting a bunch of toy language faggots here, too

Name: Anonymous 2008-07-05 17:50

I Java'ed.

Name: ThE_DaRkNeSs[MOD] 2008-07-05 18:00

>>3
Please keep on topic.

Name: Anonymous 2008-07-05 18:01

>>5
( USER WAS BANNED FOR THIS POST )

Name: Anonymous 2008-07-05 18:21

You should implement ropes rather than strings, since strings are a poor format for string operations.

Name: Anonymous 2008-07-05 18:38

>>7
Java uses Chains instead of Strings.

Name: Anonymous 2008-07-05 18:53

>>1
They don't, and neither.

Name: Anonymous 2008-07-05 20:44

What you need is a purely functional persistent lazy data structure that provides optimal amortized computational complexity.

Name: Anonymous 2008-07-05 21:38

use glib its the best

Name: Anonymous 2008-07-05 22:08

strcspn IMO

Name: Anonymous 2008-07-05 22:26

Why would they do the same? They are analogous to strcpy and strcat. Only difference is that while strncat adds a NUL-terminator, strncpy doesn't.

Name: Anonymous 2008-07-05 23:18

>>13
lol 'nul'

Name: Anonymous 2008-07-06 2:43

How do you pronounce 'strncat'?

1. stern-cat
2. ess-tee-are-en-see-eh-tee (faggot)
3. ess-tee-are-en-cat
4. stirring-cat

Name: Anonymous 2008-07-06 3:02

>>15
Like (1), but with the emphasis on “cat”.

Name: Anonymous 2008-07-06 3:30

>>15
Stringen cat.

Name: Anonymous 2008-07-06 3:42

>>15
Where is your "4. other"? Strin-cat.

Name: Anonymous 2008-07-06 5:33

>>15
I rage ever time someone tries to evolve pronounciation meme.

Name: man 2008-07-06 5:38

The stpcpy() and strcpy() functions copy the string s2 to s1 (including the terminating `\0' character).

The strcat() and strncat() functions append a copy of the null-terminated string s2 to the end of the null-terminated string s1, then add a terminating `\0'.  The string s1 must have sufficient space to hold the result.

Name: Anonymous 2008-07-06 6:03

>>20
faggot

Name: Anonymous 2008-07-06 7:53

The man page doesn't leave this clear either, it returned a bunch of Strings.
They are analogous to strcpy zerofills the result.
faggot
Hey /prog/, I've just says that supports strings, since strings are analogous to evolve pronounciation meme.
The string operations.
Java uses Chains instead of toy language that provides optimal amortized computational complexity.
use glib its the end of faggots complaining about buffer overflows.
My question is that supports strings.
I was expecting a purely functional persistent lazy data structure that supports strings.
I Java'ed.
Please keep on topic.
You should implement string s2 to hold the same? They don't leave this clear either, it just googled this clear either, it just googled this and strncat() functions copy of faggots here, too
I Java'ed.
Please keep on topic.
You should implement ropes rather than strings are a bunch of Strings.
They don't.
lol 'nul'
How do you pronounce 'strncat'?
Like (1), but with the result.
faggot
Hey /prog/, I've just googled this and strcpy() functions append a language faggots complaining about buffer.
You should implement string s2 to hold the terminating `\0'.  The strcat() and neither.
What you use?
The stpcpy() and strncat() functions append a bunch of Strings.
They are a bunch of the same? They don't leave this and strcat. Only difference is a NUL-terminator, strncpy doesn't.
lol 'nul'
How do the buffer overflows.
My question is a poor format for string s1, then add a purely functional persistent lazy data structure that while strncat adds a terminating `\0' character).
The man page doesn't.
lol 'nul'
How do the same thing, which one would they do you use?
The man page doesn't.
lol 'nul'
How do you need is, as both functions seem to hold the emphasis on topic.
You should implement string s1 must have sufficient space to do the string s2 to hold the string s2 to do the same? They don't leave this clear either, it returned a copy of Strings.
They don't leave this and neither.
What you need is your "4. other"? Strin-cat.
I was expecting a language faggots complaining about buffer.
You should implement ropes rather than strings.
I rage ever time someone tries to do you use?
The man page doesn't leave this clear either, it just googled this clear either, it just googled this

Name: Anonymous 2008-07-06 7:58

>>22
EXPERT MARKOV CHAIN

Name: Anonymous 2008-07-06 8:24

>>23
Die in a fire.

Name: Anonymous 2008-07-06 8:25

>>24
You have issues.

Name: Anonymous 2008-07-06 9:02

>>25
Die in a fair.

Name: Anonymous 2008-07-06 9:11

I always keep track of string lengths and just do memcpy.

Name: Anonymous 2008-07-06 9:15

>>27
Whatever, you turdball.

Name: Anonymous 2008-07-06 9:31

>>22,23
same fag and DIAF!

Name: >>23 2008-07-06 9:35

>>29
Nope and nope.

Name: Anonymous 2008-07-06 10:43

>>29
True, what a faggot.

Name: Anonymous 2008-07-06 11:24

>>28
Linus Turdball?

Name: Anonymous 2008-07-07 6:17

>>32
Linda Tarballs

Name: Anonymous 2008-07-07 7:38

>>33
She can tar my balls any time. If you catch my drift.

Name: Anonymous 2008-07-07 8:07

>>34
im not gonna let no bitch lather tar all over my balls

Name: Anonymous 2008-07-07 8:22

>>34
I'd unzip her if you catch my drift.

Name: Anonymous 2008-07-07 8:25

>>36
I'd check her file system if you catch my drift.

Name: Anonymous 2008-07-07 8:36

>>37 line 1 - compiler warning: "tune" expected

Name: Anonymous 2008-07-07 10:38

>>37
I'd hax her anus if you catch my drift.

Name: Anonymous 2008-07-07 17:42

>>39
I'd catch her drift if you catch my drift.

Name: Lost 2008-07-07 19:57

>>40
You Shirou'd me.

Name: Anonymous 2008-07-07 20:01

>>40
I'd fuck her tits if you catch my drift.

Name: Anonymous 2008-07-07 20:14


Woman linda_tarballs = new Woman();
Man anonymous = new Man();

if (linda_tarballs.getVirginity()){
  anonymous.rape(linda_tarballs, linda_tarballs.getVagina());
  if (linda_tarballs.isbleeding(vagina)){
    anonymous.rape(linda_tarballs, linda_tarballs.getAnus(), blood);
  else
    anonymous.kill(linda_tarballs);
}
else
  while(anonymous.hasCum()){
    anonymous.rape(linda_tarballs, linda_tarballs.getAnus());
}
  anonymous.dump(shit, linda_tarballs.getMouth());
  anonymous.dump(piss, linda_tarballs.getVagina());
  anonymous.command.make(linda_tarballs, anonymous.location.getKitchen(), pie);
  if (anonymous.inventory.getItemcount(pie) >= 1)
    anonymous.kill(linda_tarballs);

Name: Anonymous 2008-07-07 20:16

>>43
The Sussman approves the content but not the form.

Name: Anonymous 2008-07-07 20:19

>>44
Sorry, forgot the {} for the last else.

Name: Anonymous 2008-07-07 20:42

>>26
Dye in a faerie

Name: Anonymous 2008-07-08 6:58

>>43
I've taken the liberty of fixing your indentation and highlighting a syntax error:

Woman linda_tarballs = new Woman();
Man anonymous = new Man();

if (linda_tarballs.getVirginity()) {
    anonymous.rape(linda_tarballs, linda_tarballs.getVagina());

    if (linda_tarballs.isbleeding(vagina))
{
        anonymous.rape(linda_tarballs, linda_tarballs.getAnus(), blood);
    else
        anonymous.kill(linda_tarballs);

} else
    while(anonymous.hasCum()){
       anonymous.rape(linda_tarballs, linda_tarballs.getAnus());
    }

anonymous.dump(shit, linda_tarballs.getMouth());
anonymous.dump(piss, linda_tarballs.getVagina());
anonymous.command.make(linda_tarballs, anonymous.location.getKitchen(), pie);

if (anonymous.inventory.getItemcount(pie) >= 1)
    anonymous.kill(linda_tarballs);


Please ensure your code compiles before submitting it to /prog/ in the future.

Name: Anonymous 2008-07-08 7:17

>>47
There are some questionable design decisions there, too.

The first is the fact that Man.rape() takes a Woman object and a polymorphic BodyPart object. What happens when the BodyPart belongs to a different Woman?
It would be better for rape() to take a Woman and a constant denoting the BodyPart to be retrieved from the Woman, like so:

anonymous.rape(linda_tarrballs, BodyPart.VAGINA)

I also question the usefulness of being able to pass blood (an uninitialised variable, no less). Perhaps this should be reconsidered.

Next, the Man.dump() method. The first argument looks like it should be a constant, but it isn't in upper case. This is bad practice.
If shit and piss are constants, please change them to SHIT and PISS, and encapsulate them in a relevant class.

Another, quite serious, problem is with the fact that Man has a public command object, which is presumably instantiated in the constructor. That is very bad practice!
Please make this object private, and provide a getter. That would change the line

anonymous.command.make(linda_tarballs, anonymous.location.getKitchen(), pie);
to

anonymous.getCommand().make(linda_tarballs, anonymous.location.getKitchen(), pie);
And again, if pie is a constant, it needs to be in upper case.

My final complaint is not a design flaw so much as an algorithm flaw.
As written, the code allows for anonymous to give a command to a dead linda_tarballs, killing her if she carries it out. This allows for some loopholes and is less than elegant.
Please see if you can't rectify this.

Name: Anonymous 2008-07-08 12:46

>>48
It would be better for rape() to take a Woman and a constant denoting the BodyPart to be retrieved from the Woman, like so:

>Please make this object private, and provide a getter. That would change the line

Gotcha. Good suggestion.

I also question the usefulness of being able to pass blood (an uninitialised variable, no less). Perhaps this should be reconsidered.
That is the lubricant.

Name: Anonymous 2008-07-08 12:55

>>49
So blood is an object of type Lubricant? Be sure to declare and initialise the variable!

Name: Anonymous 2008-07-08 13:58


if (linda_tarballs.getVirginity()) {
    anonymous.rape(linda_tarballs, linda_tarballs.getVagina());


Why would anynomous rape linda *after* virginity GET?

Also you should try to avoid mixing camelCase and lower_case

Name: Anonymous 2008-07-08 14:04

>>51
getVirginity() just returns a boolean; it doesn't actually change anything (it doesn't have ``side effects''). By convention, getters don't have side effects.

Name: Anonymous 2008-07-08 14:10

Name: Anonymous 2008-07-08 14:16

>>53
Syntactic sugar for getters and setters? Writing them out normally is only one word and a set of parentheses longer.

Name: Anonymous 2008-07-08 14:24

>>54
Regular setters are more powerful, too, since they can have more than one argument.

Name: Anonymous 2008-07-08 14:48

>>54-55
Syntactic sugar isn't always a bad thing. You can also specify properties like this:

public class Error {
  public int LineNumber { get; protected set; }
}

which automatically generates getters and setters, then replace them with actual code later if needed. Reducing boring typing and boilerplate is nice.

Properties and methods also behave differently with respect to reflection, thus making it easier to build GUI tools such as DataGridView and PropertyGrid (granted, you could do this by marking getters and setters with attributes [does Java have those?]).

Name: Anonymous 2008-07-08 16:03

>>56
does Java have those?
I'm not sure what you mean by ``attributes''. Example?

Name: Anonymous 2008-07-08 16:05

>>56
public int LineNumber { get; protected set; }
public

Now why would you need a getters and setters?

Name: Anonymous 2008-07-08 16:08

>>58
For the protected setter?

Name: Anonymous 2008-07-08 16:17

>>57
In Java, they're ``annotations''

Name: Anonymous 2008-07-08 16:18

>>56
Indeed. Probably the worst thing about Java is its unnecessary verbosity.

Name: Anonymous 2008-07-08 18:47

>>58
That reminds me, does anyone know if changing a public field into a property affects binary compability?

Name: Anonymous 2008-07-08 20:02

>>62
It most likely does, since properties are syntactic sugar for methods, and fields are... fields.

Name: Anonymous 2008-07-08 21:28

>>63
Well in .NET it's all JIT'ed anyway, so they could have held off the decision to allow for magical inlining deliciousness. It appears that they don't, though.

Name: Anonymous 2008-07-08 22:21

>>64
The JIT is disappointing in many places. Around .NET 2.0-time, it didn't even inline any methods which had value types as parameters, even if they were under the 32-byte limit. I'm not sure if this defect still exists.

Name: Anonymous 2009-03-06 12:07


Ghetto random number generator is very large   yet finite N   so all algorithms   we CAN run   all the examples   given in K   k putchar k.

Name: Anonymous 2010-11-14 5:55

Name: Anonymous 2011-02-04 18:03

Name: Sgt.Kabukimanꁽ렝 2012-05-24 10:07

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 4:04

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List