Path: ...!news-out.netnews.com!postmaster.netnews.com!us12.netnews.com!not-for-mail X-Trace: DXC=89IXcMVh5hJL`acIL=QImGHWonT5<]0TMQ;nb^V>PUfF`L[ofA1LK4AL]XbgOa:X5b?f8H X-Complaints-To: support@blocknews.net Date: Fri, 28 Jun 2024 00:49:53 -0400 MIME-Version: 1.0 User-Agent: Betterbird (Windows) Subject: Re: Find "py.exe" & copy it to "Python" (flat, no extension). Newsgroups: comp.os.linux.advocacy 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> Content-Language: en-US From: DFS In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Lines: 33 Message-ID: <667e40f1$0$7065$882e4bbb@reader.netnews.com> NNTP-Posting-Host: 127.0.0.1 X-Trace: 1719550193 reader.netnews.com 7065 127.0.0.1:40447 Bytes: 2584 On 6/27/2024 11:42 PM, rbowman wrote: > 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 weak > Thanks you for coming in today. We will let you know one way or the other > when we make our decision. pwned