Path: ...!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: rbowman Newsgroups: comp.os.linux.advocacy Subject: Re: Find "py.exe" & copy it to "Python" (flat, no extension). Date: 28 Jun 2024 03:42:56 GMT Lines: 25 Message-ID: References: <69sj4j50b5jb8mnbc37b1aopn58vpj0a5q@4ax.com> <2Nj5O.33580$9xU7.24227@fx17.iad> <665d1d57$0$2363138$882e4bbb@reader.netnews.com> <667da789$1$7076$882e4bbb@reader.netnews.com> <667e06e3$0$2422120$882e4bbb@reader.netnews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net Xs2suSndOONSNQI0xY3ujQpB+VI1mYDP5/1CBv+k+P4BF5yp+/ Cancel-Lock: sha1:UjkG4h6KZPHjF9SACZX18AQknfA= sha256:5Tw0aGWezcXZX+Hs++xcfhtLpoMZCB8lh0X4af6m7yg= User-Agent: Pan/0.149 (Bellevue; 4c157ba) Bytes: 2310 On Thu, 27 Jun 2024 20:42:11 -0400, DFS wrote: > On 6/27/2024 8:36 PM, rbowman wrote: >> On Thu, 27 Jun 2024 13:55:22 -0400, DFS wrote: >> >>> int main(int argc, char *argv[]) >>> { >>> //vars int N = atoi(argv[1]); >>> int *nums = malloc(N * sizeof(int)); >>> int i = 0; >> >> Lemme see.... How many ways can that go wrong? > > > Where's yours? I'll stick with the code review. Assuming the program is called mode 'mode' segfault since there isn't an argv[1] 'mode foo' N is 0. malloc(0) is kind enough to return a pointer. 'mode -3' malloc returns NULL and if you're lucky you never use nums Thanks you for coming in today. We will let you know one way or the other when we make our decision.