#2580 LSL +126
int my_strcmp(const char *out, const char *in   ){
  for( ;*(in) , *(out) &&  *(in) == *(out); *out++,*in++  );
	   return   *in <= *out ?  *out > *in   : -1   ;
	}

I don't know why but it works )))

By gne4do, 2022-07-06 21:52:09
...
if (alignEntrySize & 1)
    alignEntrySize++;
if (alignEntrySize & 2)
    alignEntrySize += 2;
...
By dzuma, 2018-02-08 18:19:17
file = fopen(argv[1], "r");

if (file == NULL){}
    exit(EXIT_FAILURE);

Those silly curly braces.

By Anonymous, 2017-12-14 05:47:47
int t;

if ((t > 1) && (t < 2))
{
    errorString = errorBuffer;
	return -1;
}
By Anonymous, 2017-12-13 19:42:08
s[strlen(s)] = '\0';
By Ulfalizer, 2017-12-13 19:17:36
int min(int a,int b,int c) //Function to return the minimum.
{
  if(a < b)
  {
    if(a < c)return a;
    else if(a > c)return c;
    else return a;
  }
  else if(a > b)
  {
    if(b < c)return b;
    else if(b > c)return c;
    else return b;
  }
  else
  {
    if(a < c) return a;
    else if(a > c) return c;
    else return a;
  }
}

This kind of things make me hate my work.

By Another random student of algorithms., 2017-12-14 00:45:52
int minimum(int a, int b, int c){
  int mini =a*b*c;
  int iterator=0;
  int test[3];
  test[0]=a;
  test[1]=b;
  test[2]=c;
  for (iterator=0;iterator<3;iterator++){
    if (test[iterator]<mini){
      mini=test[iterator];
    }
  }
  return mini;
}

I hope that your 3 numbers aren't larger than 1290!

By Another random student of algorithms., 2017-12-14 01:28:18
if (argv[1][0]=='D'){
                demo=1;
                argv[1]++;
        }

        if (argv[1][0]=='P'){
                if (sscanf(argv[1], "P%ux%ux%ux%ux%lfx%ux%u"
                                ,&temporal_resample
                                ,&input_w, &input_h, &rate, &input_gamma
                                ,&output_w
                                ,&output_h)!=7){
                        fprintf(stderr,"%s: Invalid argument format\n", progname);
                        print_usage();
                        exit(3);
                }
                ppm=1; 
         }else{
                if (sscanf(argv[1], "%ux%ux%ux%ux%lfx%ux%u"
                                ,&temporal_resample
                                ,&input_w
                                ,&input_h
                                ,&rate
                                ,&input_gamma
                                ,&output_w
                                ,&output_h)!=7){
                        fprintf(stderr,"%s: Invalid argument format\n", progname);
                        print_usage();
                        exit(3);
                }

Found in a chroma subsampling algorithm.

By Anonymous, 2021-03-18 19:51:47
		if (wiringPiMode == WPI_MODE_PINS)
			pin = pinToGpio[pin];
		else if (wiringPiMode == WPI_MODE_PHYS)
			pin = physToGpio[pin];
		else if (wiringPiMode != WPI_MODE_GPIO)
			return;

the 3rd condition check throws you right off the train of logic.

By Gordon Henderson, 2019-07-23 06:05:05
int true = 0;
while (true)
{
    //do something
}

true = false

By noz1995, 2017-12-15 16:08:59
double func_atof(char *p){
	double	 integer = 0.0, div = 1.0 , fract = 0.0 , sign = 1.0;
   if(   *p == 45  ){sign = -1.0, *p++ ; }
	while ( isdigit(*p)  ) { 
		integer = ( *p++ )  +  (10.0   *   integer)  -  48.0 ; 
		}
	if(*p == 46  ){
	(*p++ ) ;
	while (  isdigit(*p) )  {
		fract = ( *p++ )  +  (10.0   *   fract)  -  48.0  ; 
		div *= 10;		
		}
    }
  return    (integer  +   fract  / div )  * sign    ;
}
By Lazy_8, 2020-01-13 16:53:53
void destroy_phone(T9obj* ptr_T9Obj){
    free(ptr_T9Obj);
}

Such thoughtful name!

By farhanhubble, 2019-05-30 08:57:39
bool calculateLeapYear(uint8_t year) {
    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
        return true;
    } else {
        return false;
    }
}

uint8_t and a useless if.

By eha, 2023-06-19 23:01:57
#include<stdio.h>
#include<stdlib.h>	
#include<string.h>	
	int main(void){
	void run_func(char *map[], char *fnt  , char *km , float *x ,  float *y , int line , int row , int lift    );
				char *long_met[3][8] = {{"mile","0.621371"  ,  "yard","1093.61" , "fut","3280.84" , "duim","39370.1" } ,
							{ "mile" ,"1.60934" , "yard","0.0009144" ,  "fut","0.0003048" ,  "duim","0.0000254"},
 			   				{"kilometer","1"  , "meter","1000"  ,   "stmeter","100000" ,   "mmeter","1000000" } }; 
				char *amount[3][4] = { { "gallon" , "0.264172" ,       "quarta" , "1.05669"     } , 
						{"gallon" , " 3.78541"  ,     "quarta" , "0.946353"   },
						{"litr" , "1"  , "mililitr" , "1000"   }};
				char *mass[3][8] = {   {"eng.tonna","0.984207"  ,  "amer.tonna","1.10231" , "stone","157.473" , "funt","2204.62" } ,
   						{ "eng.tonna" , "1.01605" , "amer.tonna", "0.907185" ,  "stone","0.00635029" ,  "funt","0.000453592"},
						{"tonna","1" ,         "kilogram" , "1000"  , "miligram","100000"   , "microgram","1000000"  }}; 
				char **cp;
				char *buf_data;
				char *fnt_sys;
				char *mtr_sys;
				char *word[100];
	while(1){
	int bg  = 0,convert_ch = 3,y = 0, d = 0, numb = 0;
  	float mn =0  , xm = 0 ;
	printf("%s", "enter data for converter: ");
		fgets( (char *) word, 99 ,stdin);
		buf_data = strtok((char *) word, " ");
		if( ! strcmp(buf_data, "funt.sys"   )     ){
		convert_ch = 0;	
		}
		else	if( ! strcmp(buf_data, "metric.sys"    )     ){
			convert_ch = 1;	
		}
		for( bg = 0 ;  buf_data != NULL;  buf_data = strtok(NULL, " ")  , bg++ ) {
			switch(bg){
				case 1:
					if( !strcmp("long_met" , buf_data  )  ){
			  			 y	=   sizeof(*long_met) / sizeof(long_met[0][0]); 
	          	      	                 d	=   sizeof(long_met) /   sizeof(long_met[0][0]); 
			  		        cp  = &long_met[convert_ch][0]  ;
					}
			   		else if(!strcmp("amount" , buf_data  ) ){
			  			 y	= sizeof(*amount) /  sizeof(amount [0][0]); 
		            	                 d	= sizeof(amount) /  sizeof(amount[0][0]); 
				    	        cp = &amount[convert_ch][0] ;
					}
				 	else if(!strcmp("mass" , buf_data  ) ){
				  		 y	= sizeof(*mass ) /  sizeof(mass[0][0]); 
		         		         d	= sizeof(mass ) /  sizeof(mass[0][0]); 
				 		 cp = &mass[convert_ch][0] ; 
					}
					break;
				case 2:
				fnt_sys = buf_data;
					break;
				case 3:
				mtr_sys = buf_data;
					break;
				case 4:
				numb =   atoi(buf_data);
					break;
			}
		}
		if( !y || !d || !cp || convert_ch == 3 || !numb ){
	
			puts("error");
		}
		else{
			run_func( cp,   fnt_sys ,  mtr_sys , &mn ,  &xm , y  , d , convert_ch );
			if( !mn || !xm  ){
		puts("error");
				} else{
			printf("%f\n" , !convert_ch  ?    (mn  /  xm ) * numb :  (  mn  *  xm   ) * numb         );	
			}
		}
	}
	return 0;
	}
	void run_func(char *map[], char *fnt  , char *km , float *x ,  float *y , int line , int row  , int lift    ){
		int m ;
	if(  ( lift )   ){
			row    -= line;	
		}
	for(  m = 0 ; m <= line   ; m++){
		if(!strcmp(fnt,map[m])){
			*x = atof(map[m  + 1] )  ;
			break;
			}
		}
	for( m =   (row  - line) ; m <=  row - 1  ; m++){
		if( !strcmp( km   ,  map[m] ) ){
			*y = atof(map[m  + 1 ] );
			break;
				}
			}
		}
By Gne4do, 2019-02-26 14:38:14
#include <stdio.h>
#include<stdlib.h>
#include<time.h>

void randy(int array[] ){
int i = 0  , d = 0;
		for(i = 1 ; i <= 23 ; i++){
			
			array[i] =  1 + (rand() % 365 ); 
		}
	}

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}



int find (int arr[]){
 int d = 0;
 	
 	for(d = 1  ;d <=23 ; d++ ){
 		
		 if(arr[d] == 	 arr[d + 1]){
		 	return 1;
		 }
	 }
	
	return 0;
}

int main(void){
	 double count_birthday = 0;
	int  people[24];
  
	srand(time(NULL));
	
	int c = 0 ;
	long double ip = 0;
	
	
	
	while(ip++ <= 1000000 ){
		

		randy(people);
		qsort (people, 25, sizeof(int), compare);
		if(find (people) == 1 ){
			count_birthday++;
		}

	}

printf("%.2lf", 	count_birthday  / 10000  );
return 0;
}
By lazy_8, 2020-03-04 13:14:05