Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-01 Thread Jorgen Grahn
On Wed, 2010-06-30, Michael Torrie wrote: On 06/30/2010 03:00 AM, Jorgen Grahn wrote: On Wed, 2010-06-30, Michael Torrie wrote: On 06/29/2010 10:17 PM, Michael Torrie wrote: On 06/29/2010 10:05 PM, Michael Torrie wrote: #include stdio.h int main(int argc, char ** argv) { char *buf =

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Jorgen Grahn
On Wed, 2010-06-30, Michael Torrie wrote: On 06/29/2010 10:17 PM, Michael Torrie wrote: On 06/29/2010 10:05 PM, Michael Torrie wrote: #include stdio.h int main(int argc, char ** argv) { char *buf = malloc(512 * sizeof(char)); const int a = 2, b = 3; snprintf(buf, sizeof buf,

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Michael Torrie
On 06/30/2010 03:00 AM, Jorgen Grahn wrote: On Wed, 2010-06-30, Michael Torrie wrote: On 06/29/2010 10:17 PM, Michael Torrie wrote: On 06/29/2010 10:05 PM, Michael Torrie wrote: #include stdio.h int main(int argc, char ** argv) { char *buf = malloc(512 * sizeof(char)); const int a =

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Lawrence D'Oliveiro
In message mailman.2369.1277870727.32709.python-l...@python.org, Michael Torrie wrote: Okay, I will. Your code passes a char** when a char* is expected. No it doesn’t. Consider this variation where I use a dynamically allocated buffer instead of static: And so you misunderstand the

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Lawrence D'Oliveiro
In message mailman.2332.1277785175.32709.python-l...@python.org, Kushal Kumaran wrote: On Tue, Jun 29, 2010 at 5:56 AM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: Why does this work, then: l...@theon:hack cat test.c #include stdio.h int main(int argc, char ** argv) {

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:25 PM, Lawrence D'Oliveiro wrote: I have yet to find an architecture or C compiler where it DOESN’T work. Feel free to try and prove me wrong. Okay, I will. Your code passes a char** when a char* is expected. Every compiler I know of will give you a *warning*. Mistaking

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:05 PM, Michael Torrie wrote: #include stdio.h int main(int argc, char ** argv) { char *buf = malloc(512 * sizeof(char)); const int a = 2, b = 3; snprintf(buf, sizeof buf, %d + %d = %d\n, a, b, a + b); ^^ Make that

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:17 PM, Michael Torrie wrote: On 06/29/2010 10:05 PM, Michael Torrie wrote: #include stdio.h int main(int argc, char ** argv) { char *buf = malloc(512 * sizeof(char)); const int a = 2, b = 3; snprintf(buf, sizeof buf, %d + %d = %d\n, a, b, a + b);

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-28 Thread Lawrence D'Oliveiro
In message mailman.2231.1277700501.32709.python-l...@python.org, Kushal Kumaran wrote: On Sun, Jun 27, 2010 at 5:16 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.2184.1277626565.32709.python-l...@python.org, Kushal Kumaran wrote: On Sun, Jun 27, 2010

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-28 Thread Kushal Kumaran
On Tue, Jun 29, 2010 at 5:56 AM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.2231.1277700501.32709.python-l...@python.org, Kushal Kumaran wrote: On Sun, Jun 27, 2010 at 5:16 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message