diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-14 05:49:22 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-14 05:49:22 +0000 |
commit | dec918479ff8aec20f531a88f53b71fecba4067a (patch) | |
tree | 1fe7c0c583409a752d4e869139751ef10ef238ee /src/interfaces/python/tutorial/syscat.py | |
parent | 538b1015958dbbe447434909a6412e79d4298643 (diff) | |
download | postgresql-dec918479ff8aec20f531a88f53b71fecba4067a.tar.gz postgresql-dec918479ff8aec20f531a88f53b71fecba4067a.zip |
I guess I'd vote for changing the code to be
sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1);
if (!sys)
return false;
sprintf(sys, "exec '%s' '%s'", editorName, fname);
(note the added quotes to provide a little protection against spaces
and such). Then it's perfectly obvious what the calculation is doing.
I don't care about wasting 20-some bytes, but confusing readers of the
code is worth avoiding.
regards, tom lane
Diffstat (limited to 'src/interfaces/python/tutorial/syscat.py')
0 files changed, 0 insertions, 0 deletions