[med-svn] [Git][med-team/codonw][master] 2 commits: remove-gets.patch: new: replace gets by fgets.
Étienne Mollier (@emollier)
gitlab at salsa.debian.org
Sun Mar 17 17:33:01 GMT 2024
Étienne Mollier pushed to branch master at Debian Med / codonw
Commits:
5fbba98d by Étienne Mollier at 2024-03-17T18:28:30+01:00
remove-gets.patch: new: replace gets by fgets.
Closes: #1066326
- - - - -
641c16a0 by Étienne Mollier at 2024-03-17T18:32:27+01:00
ready to upload to unstable.
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/remove-gets.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+codonw (1.4.4-8) unstable; urgency=medium
+
+ * Team upload.
+ * remove-gets.patch: new: replace gets by fgets. (Closes: #1066326)
+
+ -- Étienne Mollier <emollier at debian.org> Sun, 17 Mar 2024 18:32:09 +0100
+
codonw (1.4.4-7) unstable; urgency=medium
* Team upload
=====================================
debian/patches/remove-gets.patch
=====================================
@@ -0,0 +1,300 @@
+Description: replace gets invocations by fgets.
+ We assume that under normal conditions, each fgets invocations does not need
+ more than BUFSIZ amount of memory, otherwise the input will get to the next
+ fgets invocation. Crude still much better than straight gets invocation.
+
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/1066326
+Forwarded: no
+Last-Update: 2024-03-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- codonw.orig/codonW.h
++++ codonw/codonW.h
+@@ -35,7 +35,7 @@
+ #define debug_ printf("Got to %i\n",debugger++);
+ #define debug(x) printf( #x " = %d", x);
+ /* defile the macro pause */
+-#define pause {fprintf(stderr,"\nPress return or enter to continue -> ");gets(pm->junk);}
++#define pause {fprintf(stderr,"\nPress return or enter to continue -> ");fgets(pm->junk, BUFSIZ, stdin);}
+ #define MAX_FILENAME_LEN 90 /* max filename */
+
+ /* define the structures used within codonW */
+--- codonw.orig/codon_us.c
++++ codonw/codon_us.c
+@@ -649,7 +649,7 @@
+
+ printf("\nDo you wish to input a personal choice of CAI"
+ " values (y/n) [n] ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+
+ /* This allows a user defined choice of CAI values to be selected */
+ if ('Y' == (char) toupper( (int) pm->junk[0])) {
+@@ -756,7 +756,7 @@
+ printf("\nDo you wish to input a personal choice of CBI"
+ " values (y/n) [n] ");
+
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+
+ if ('Y' == (char) toupper( (int) pm->junk[0])) {
+
+@@ -896,7 +896,7 @@
+
+ printf("\nDo you wish to input a personal choice of Fop"
+ " values (y/n) [n] ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ('Y' == (char) toupper( (int) pm->junk[0])) {
+ printf("\nInput file must contain 64 Fop values\n"
+ " 1= rare codon\n 2= common codon\n 3= optimal codon\n");
+@@ -954,7 +954,7 @@
+ "(Fop=(opt-rare)/total)\n else the original formulae "
+ "will be used (Fop=opt/total)\n\n\t\tDo you wish "
+ "calculate a modified fop (y/n) [n] ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( 'Y' == (char) toupper( (int)pm->junk[0]))
+ factor_in_rare = TRUE;
+ asked_about_fop = TRUE;
+--- codonw.orig/menu.c
++++ codonw/menu.c
+@@ -103,7 +103,7 @@
+ printf ("\t (Q) Quit \n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+
+ if (isalpha((int)pm->junk[0])) {
+ c = toupper( (int) pm->junk[0]);
+@@ -230,7 +230,7 @@
+ printf ("\t ( ) Sorry currently unimplemented \n");
+ printf ("\t (X) Exit this menu\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha((int)pm->junk[0]) || pm->junk[0]=='\0' ) {
+@@ -302,7 +302,7 @@
+ printf ("Choices enclosed with curly brackets are the current "
+ "defaults\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha((int) pm->junk[0])|| pm->junk[0]=='\0') {
+@@ -342,7 +342,7 @@
+ (pm->seperator == ',' ) ? "," :
+ "ERROR" );
+ printf (" Please select a new separator \t:");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ c = pm->junk[0]; /* take first character of string */
+
+ if ( strchr ("\t, ", (int)c) == NULL || c == '\0' ) {
+@@ -379,7 +379,7 @@
+ case 4: /* No of line on term*/
+ printf("Please give the new height of the screen [%i] ",
+ pm->term_length);
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( isdigit( (int) pm->junk[0]))
+ pm->term_length = atoi(pm->junk) ;
+ break;
+@@ -398,7 +398,7 @@
+ printf("Choice enclosed with curly brackets is "
+ "the current code\n");
+ printf("Please select a new code [no change]\n");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( isdigit( (int) pm->junk[0]) ) {
+ c = (char)atoi(pm->junk);
+ if ( c > 0 && c < NumGeneticCodes && pm->code!= (char) c ){
+@@ -422,7 +422,7 @@
+ printf ("Choice enclosed with curly brackets is the current "
+ "selection\n");
+ printf ("Please select a type [no change]\n");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( isdigit( (int) pm->junk[0]) ) {
+ c = (char)atoi(pm->junk);
+ if ( c > 0 && c < NumFopSpecies && pm->f_type!=(char) c) {
+@@ -447,7 +447,7 @@
+ printf ("Choice enclosed with curly brackets is the current "
+ "selection\n");
+ printf ("Please chose a new CAI [no change]\n");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( isdigit( (int) pm->junk[0]) ) {
+ c = (char)atoi( pm->junk);
+
+@@ -577,7 +577,7 @@
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+
+
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+
+ if (isalpha( (int) pm->junk[0]) || pm->junk[0]=='\0') {
+ switch (c = toupper( (int) pm->junk[0])){
+@@ -761,7 +761,7 @@
+ }
+ printf (" (X) Exit this menu\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha( (int) pm->junk[0]) || pm->junk[0]=='\0') {
+@@ -811,7 +811,7 @@
+
+ if ( pm->coa ) {
+ printf( " Do you wish to see the advanced COA menu (Y/N) [N] ");
+- gets( pm->junk );
++ fgets( pm->junk , BUFSIZ, stdin);
+
+ /* Select the default codon/AAs to analyse, based on genetic code */
+ initilize_coa (pm->code);
+@@ -841,7 +841,7 @@
+ printf ("\t ( ) Sorry currently unimplemented \n");
+ printf ("\t (X) Exit this menu\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha( (int) pm->junk[0])|| pm->junk[0] == '\0') {
+@@ -890,7 +890,7 @@
+ printf (" (1) Test your knowledge of the genetic code \n");
+ printf (" (X) Exit this menu\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha( (int) pm->junk[0]) || pm->junk[0]=='\0') {
+@@ -972,7 +972,7 @@
+ if ( pm->analysis_run ) {
+ printf (" The current bulk output file is %s do you "
+ "wish to change this (y/n) [n] ", pm->curr_tidyoutname);
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+
+ if ( toupper( (int) pm->junk[0]) == 'Y') {
+ fileclose(&pm->tidyoutfile);
+@@ -1004,7 +1004,7 @@
+ printf ("Values enclosed with curly{} brackets are the current "
+ "selection\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha( (int) pm->junk[0]) || pm->junk[0]=='\0') {
+@@ -1064,7 +1064,7 @@
+
+ printf (" (X) Exit this menu\n");
+ printf (" Select a menu choice, (Q)uit or (H)elp -> ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ clearscr(pm->term_length);
+
+ if (isalpha( (int) pm->junk[0]) || pm->junk[0]=='\0' ) {
+@@ -1094,7 +1094,7 @@
+ case 2: /* Num of axis to record */
+ printf ( "Changing the number of axis generated from %i "
+ "Please input new value [%i]", (int)pcoa->axis,(int)pcoa->axis);
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( !strlen(pm->junk) ) break;
+ if ( isalpha( (int) pm->junk[0])) break;
+ i = (char)atoi(pm->junk);
+@@ -1114,7 +1114,7 @@
+ "You must have a separate file containing sequence(s) that are\n"
+ "to be added (these genes must be DNA in fasta format)\n"
+ "Please input filename [cancel this option]: ");
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+ if ( !strlen(pm->junk) ) break;
+ strncpy(pcoa->add_row,pm->junk,MAX_FILENAME_LEN-1);
+ break;
+@@ -1127,7 +1127,7 @@
+ "You can input either an absolute number of genes or a\n"
+ "percentage (example 10%%)\n "
+ "\tPlease input your choice []");
+- gets ( pm->junk);
++ fgets ( pm->junk, BUFSIZ, stdin);
+ if( !strlen(pm->junk) ) continue;
+ if( (p=strchr ( pm->junk,'%')) != NULL) {
+ *p='\0';
+@@ -1221,7 +1221,7 @@
+ "(X to exit, H for help) [X] ",
+ (pm->coa == 'a')? "Amino Acids": "Codons" );
+
+- gets(pm->junk);
++ fgets(pm->junk, BUFSIZ, stdin);
+
+ if ( !strlen(pm->junk) || toupper( (int) pm->junk[0]) == 'X' ) {
+ loop=FALSE;
+--- codonw.orig/open_fil.c
++++ codonw/open_fil.c
+@@ -85,7 +85,7 @@
+ while (!strlen(infile_name) ) {
+ printf("\nName of %s (h for help) [%s] ",
+ file_needed,default_filename);
+- gets(infile_name); /* get filename */
++ fgets(infile_name, BUFSIZ, stdin); /* get filename */
+
+ if ( WasHelpCalled ( infile_name ) ) {
+ chelp("open_file_query"); /* Help .... */
+@@ -130,7 +130,7 @@
+ no_file_found();
+ fprintf(stderr, "\n\nPlease enter another filename, "
+ " (Q)uit, (H)elp [%s] ",infile_name);
+- gets(answer);
++ fgets(answer, BUFSIZ, stdin);
+
+ if (strlen (answer)==1 &&
+ ((char)toupper((int)answer[0])=='Q'))
+@@ -183,7 +183,7 @@
+ "\nYou decided not to overwrite, please enter\n"
+ " another filename, (q)uit, (a)ppend, (h)elp \n"
+ " (a/q/h/filename)\t[a] ");
+- gets(answer);
++ fgets(answer, BUFSIZ, stdin);
+ }
+
+ /* if the answer is 'a' then the default file is opened */
+--- codonw.orig/tester.c
++++ codonw/tester.c
+@@ -85,7 +85,7 @@
+ while ( loop ) {
+ printf("\nWhat is the three letter equivalent for the AA"
+ " %s ", paa->aa1[i]);
+- gets( pm->junk ) ;
++ fgets( pm->junk , BUFSIZ, stdin) ;
+ strcpy ( tmp_AA, paa->aa3[i] );
+ for ( x = 0 ; x < (int)strlen(tmp_AA); x++)
+ tmp_AA[x] = (char) toupper( (int) tmp_AA[x]);
+@@ -122,7 +122,7 @@
+ while ( loop ) {
+ printf("\nHow many codons encode the Amino Acid %s ",
+ paa->aa1[i]);
+- gets( pm->junk ) ;
++ fgets( pm->junk , BUFSIZ, stdin) ;
+ for ( x = 0 ; x < (int)strlen(pm->junk); x++)
+ pm->junk[x] = (char) toupper( (int) pm->junk[x]);
+
+@@ -167,7 +167,7 @@
+ loop = TRUE;
+ while ( loop ) {
+ printf("\nName the Amino Acid encoded by the codon %s ", paa->cod[i]);
+- gets( pm->junk );
++ fgets( pm->junk , BUFSIZ, stdin);
+ for ( x = 0 ; x < (int)strlen(pm->junk ); x++)
+ pm->junk[x] = (char) toupper( (int) pm->junk[x]);
+ if ( !strcmp ( pm->junk, "QUIT" ) ||
=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@ spelling
helpfile_location
fix_link_name_clashes
remove_nondeterminism
+remove-gets.patch
View it on GitLab: https://salsa.debian.org/med-team/codonw/-/compare/bf4bea4586302b71563d599aa7e2e035c8733f18...641c16a0415de9d4d0f0929fbbd1de438b7ccd30
--
View it on GitLab: https://salsa.debian.org/med-team/codonw/-/compare/bf4bea4586302b71563d599aa7e2e035c8733f18...641c16a0415de9d4d0f0929fbbd1de438b7ccd30
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240317/0c64fd28/attachment-0001.htm>
More information about the debian-med-commit
mailing list