1. Поиск говнокода

    Этот поиск практически ничего не может найти! Но вы всё-таки попытайтесь, вдруг повезет.

    Найдено: 35

  2. Си / Говнокод #6769

    +140

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    if (m_socket == INVALID_SOCKET)
        {
    		printf("Client: socket() - Error at socket(): %ld\n", WSAGetLastError());
           
    		WSACleanup();
    
                     return EXIT_SUCCESS;
        }

    Лаба знакомого о сетям.


    Очень, блин, SUCCESS!

    lNevermore, 27 Мая 2011

    Комментарии (32)
  3. C++ / Говнокод #5970

    +169

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    #include <iostream>
    #include <cstdlib>
    #include "filesdescrtable.h"
    
    int ___cntr = 0;
    #define _(X) if((X) == EXIT_SUCCESS) {___cntr++;} else {std::cerr << "error on operator: " << ___cntr << std::endl; return (EXIT_FAILURE);}
    
    int main (int argc, char *argv[]) {
    	FilesDescrTable a;
    
    	int d1,d2,d3;
    
    	_(a.setAutoReport(true));
    	_(a.openFile(argv[1], O_RDWR | O_CREAT, 0600, d1));
    	_(a.openFile(argv[2], O_RDWR | O_CREAT, 0600, d2));
    	_(a.openFile(argv[3], O_RDWR | O_CREAT, 0600, d3));
    	_(a.clearFile(argv[3]));
    	_(a.cpy(d3,d2));
    	_(a.closeFile(d1));
    	_(a.closeFile(d2));
    	_(a.closeFile(d3));
    
    	return(EXIT_SUCCESS);
    }

    хитрый макрос для отлова ошибок. такой хитрый

    cahekm, 13 Марта 2011

    Комментарии (9)
  4. C++ / Говнокод #4492

    +166

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    #include "stdafx.h"
    #include <iostream>
    #include <locale>
    #include <conio.h>
    typedef unsigned short int g;
    int main()
    {
            g b=0;g m=1;
            std::wcout.imbue(std::locale(".866"));
            for(g i=0;m==1;i++)
            {
            try
            {
            std::wcout<<L"Введите столбец по которому надо сортировать(меньше 10)";
            std::cin>>b;m=0;
            }
            catch(...){m=1;}
            }
            return EXIT_SUCCESS;
    }

    http://www.cyberforum.ru/cpp/thread550.html
    "Здравствуйте! мне надо чтобы если юзер вводит неверные данные ему было предложено вновь ввести данные заново.Почему этого не происходит"

    OverOverMind, 31 Октября 2010

    Комментарии (3)
  5. Си / Говнокод #4137

    +138

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    static const char*const nullp,From_[]=FROM,exflags[]=RECFLAGS,
     drcfile[]="Rcfile:",pmusage[]=PM_USAGE,*etcrc=ETCRC,
     misrecpt[]="Missing recipient\n",extrns[]="Extraneous ",ignrd[]=" ignored\n",
     pardir[]=chPARDIR,curdir[]={chCURDIR,'\0'},
     insufprivs[]="Insufficient privileges\n",
     attemptst[]="Attempt to fake stamp by";
    char*buf,*buf2,*loclock,*tolock;
    const char shell[]="SHELL",lockfile[]="LOCKFILE",newline[]="\n",binsh[]=BinSh,
     unexpeof[]="Unexpected EOL\n",*const*gargv,*const*restargv= &nullp,*sgetcp,
     pmrc[]=PROCMAILRC,*rcfile=pmrc,dirsep[]=DIRSEP,devnull[]=DevNull,
     lgname[]="LOGNAME",executing[]="Executing",oquote[]=" \"",cquote[]="\"\n",
     procmailn[]="procmail",whilstwfor[]=" whilst waiting for ",home[]="HOME",
     host[]="HOST",*defdeflock,*argv0="",errwwriting[]="Error while writing to",
     slogstr[]="%s \"%s\"",conflicting[]="Conflicting ",orgmail[]="ORGMAIL",
     exceededlb[]="Exceeded LINEBUF\n",pathtoolong[]=" path too long";
    char*Stdout;
    int retval=EX_CANTCREAT,retvl2=EXIT_SUCCESS,sh,pwait,lcking,rcstate,rc= -1,
     ignwerr,lexitcode=EXIT_SUCCESS,asgnlastf,accspooldir,crestarg,skiprc,
     savstdout,berkeley,mailfilter,erestrict;
    size_t linebuf=mx(DEFlinebuf+XTRAlinebuf,1024/*STRLEN(systm_mbox)<<1*/);
    volatile int nextexit;			       /* if termination is imminent */
    pid_t thepid;
    long filled,lastscore;	       /* the length of the mail, and the last score */
    char*themail,*thebody;			    /* the head and body of the mail */
    uid_t uid;
    gid_t gid,sgid;

    Источник: http://opensource.apple.com/source/procmail/procmail-1.2/procmail/src/procmail.c

    sanchousf, 31 Августа 2010

    Комментарии (32)
  6. C++ / Говнокод #3519

    +152

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    #include <fstream>
    using namespace std;
    #define ES EXIT_SUCCESS
    #define FOR(i___,___n) for (int i___=0; i___<(int)___n; i___++)
    #define RFOR(i__,__n,_n)  for (int i__=__n; i__>=_n; i__--)
    #define or(i__,__s) fstream i__((char*)__s)
    #define ow(i__,__s) ofstream i__((char*)__s)
    #define MEM(a,b) a=new char[b]
    #define MEM1(a,b) a=new char*[b]
    #define RFOR1(i__,_i,__n,_n)  for (int i__=__n,  _i=_n; i__>=_n; i__--,_i++)
    int N,L,D;
    char **F, *W;
    int main()
    {	
    	or(in,"input.txt");	ow(out,"output.txt");
    	in>>N>>L>>D;
    	MEM(W,N),MEM1(F,N+1), in.get();
    	FOR(i,N-L+1)	W[i]='0';
    	FOR(i,L) W[N-L+i]=in.get();
    	FOR(i,N+1)	MEM(F[i],2), F[i][0]=F[i][1]=0;
    	F[0][0]=1;
    	RFOR1(j,i,N-1,0)
    		if (W[j]=='0')
    			F[i+1][1]=F[i][1],	F[i+1][0]=(F[i][0] + F[i][1])%D;
    		else
    			F[i+1][1]=(F[i][1] +F[i][0])%D,	F[i+1][0]=F[i][0];
    	out<<(int)F[N][0];
    	return ES;
    }

    jte, 20 Июня 2010

    Комментарии (2)