@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14



Comments:

<0> strlen gives 4 .. and the length of the data is FAR longer than that
<1> of course 4 is the size of a pointer n ur system for that type
<2> Caligo, why do you use *ptr and not char thing = "whatever" ?
<0> level_: its complicated..
<0> .:)
<0> i just found out something is amiss with my string...
<1> of course that has nothing todo with why strlen reporten 4:p
<1> bed time
<0> damnit
<0> cant figure out the problem...
<0> i must be missing something painfully obvious again
<0> when i send plaintext to my command explodec("whatever;whatever",0); it works, but when i send the info in a ptr, explodec(myPointer,0); when myPointer has that exact same info, it doesnt work
<0> is this a general problem ppl usually have?
<0> is there a way to convert the info stored in a *prt to a char x = "blabla" ?
<0> anyone awake?
<3> What is ptr? void *?



<0> no, char *ptr = "some;neat;****";
<0> kinda
<2> pointer.
<3> char x = "blahbla" is invalid
<0> ye
<0> well, did u read what i typed up there?
<0> thats the stuff im refering to
<0> to make somefunction(myPointer,0); behave the same way as somefunction("bla;bla;bla",0);
<0> when myPointer contains "bla;bla;bla"
<0> cause when i recieve the "" version, i can strlen it and everything works sweet
<0> but when i recieve the myPointer, nothing works inside the function
<4> do you declare myPointer like this: char *mypointer = "whatever;whatever"; ?
<0> myme: in a pinch, yes
<4> Caligo: weird...
<0> thats what ive been saying the last couple of hours
<0> whilst scratching my head
<1> char x = "whatever"; would still be invalid tho i'd think
<4> hehe...
<4> just came in 15 min ago
<1> as char x is only 1 byte wide
<0> rip: yea, i dont use that
<4> rip: char *x = "";
<1> well read what he said above
<4> ahh
<0> rip: i was looking for a way to transform *ptr to something else like ""
<1> <+Caligo> is there a way to convert the info stored in a *prt to a char x = "blabla" ?
<4> hmm
<4> rip: hope he made it a pointer
<4> :P
<1> yeah cuz that would overflow and nly store 1 byte :/
<4> char x = "bla bla"; ... then in the method call: someFunction(&x); lol
<0> damn im havin netproblems..
<0> ffs
<4> hehe
<0> did i miss anything?
<4> prolly your prog doing it
<4> :P
<0> probably my wlan router
<4> mhm
<0> anyhew.. did i miss anything of value whilst i was out?
<0> like a sollution? hopes
<4> try this then: char c[] = {'a', 'b', 'c', '\0'};
<4> to have control over WHAT the string holds :P
<0> ehm
<0> but if i have it in a ptr.. how do i convert it?
<1> and if u want whatever your pointer contains into a char buffer
<0> rip: thats exactly what i want
<1> you use strlen, and malloc the space + 1 for it:P
<4> and then strcpy
<0> hmm
<0> just hold a moment...
<1> if you want a static buffer
<0> im tryin it
<1> use char buf[] = {0};
<4> DAMN, spilled my coffee
<1> coffee abuse!
<4> mhm
<4> indeed
<1> and then strcpy of curse Caligo
<4> ;)
<1> and of cuorse put a size to your buffer:p



<1> and dnt overflow it
<4> and of course, spell course right :P haha
<4> j/k
<1> ive slept for just a few hours, can you really blame me?:P
<4> hehe, nah, same deal here... was planning a nap now as a matter of fact. Try some coffee first
<0> uhm
<4> Might just end up shaking, but who cares.
<1> well i have to go round the clock to get back into pattern :/
<1> been going to 7am last 3 weeks:/
<0> so i do char b[] = {0}; b = malloc(strlen(mypointer)); ?
<4> haha, that's what my friend does too.
<1> no caligo
<1> if you want to malloc dynamic memory b must also be a pointer
<1> of the type u want to allocate
<4> char *b = malloc(strlen(yourstring+1));
<1> and malloc should be cast with the wanted pointer type
<0> but... then that defies the point of this all
<1> no:P
<0> then b wont be a char .. it will be another damn pointer
<1> yes but you could operate on it as a buffer
<4> Caligo: you need a char? not a ptr?
<1> since its dynamically allocated memory
<1> but as i said
<1> you can use a static buffer
<4> you could do this *(ptr+offset) <--- = char
<1> char b[256] = {0};
<0> rip: and how do i get the info from my pointer into the static buffer?
<1> strcpy(b, wtf);
<0> ok
<0> ill try that then
<1> where wtf is your pointer
<1> howevef if u are making an explode function i would recommend you look at pcre (pcre.org)
<4> char *ptr = "testy-schmesty"; *ptr == 't', *(ptr+1) == 'e', *(ptr+2) == 's'
<4> :)
<0> yes!!
<0> HEUREKA!!! it works
<0> :>
<1> and also treat the data as binary, as nullbytes could ruin your day :/
<0> thanx rip and myme
<4> ;)
<4> Caligo: if you do what i did there you won't have to move it
<4> too late
<1> stable connection
<1> :P
<4> haha
<1> i bet theres a hummingbird powering that modem
<4> heh...
<4> Yeah, poor fellah needs a break from time to time.
<1> great so we made someones day today, now for one to ruin.
<4> heh...
<1> wtf?:)
<4> "Oops, sorry"
<4> hehe
<4> That's how you ruin a day.
<1> hehe
<4> damn, that album came down quickly
<1> that's usually something to be happy about
<4> damn in a good way
<0> wtf..
<0> whats wrong with my wlan, keep bouncing out
<4> hehe
<1> change the channel
<1> might be intereferejce
<4> mhm
<1> interference even
<0> ima look into that later.. right now im on a roll with the coding :)
<0> thanx to you guys
<4> Caligo: np
<1> np
<4> ;)
<0> the method of strcpy to a static buffer was implementable on several occasions
<4> hehe
<0> which made the code be much less errorfilled


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

WinXP installation USB-CDROM
vi command to unhighlight
httpd 1.3.33 and metasploit
#stocks
get around a rar password
#photoshop
#computers
#online
#flash
can't believe foot message



Home  |  disclaimer  |  contact  |  submit quotes